Unresolved Symbol reference for CMake Project (with Hello World) Template #582
Replies: 3 comments 3 replies
-
For me the workaround was to configure the indexer to index files open in editor. Strangely, I then disabled this option but everything continued to work, so perhaps you just need to enable it initially once. One of the many CDT indexer quirks it seems. Just an FYI you can reindex your project (Index/Rebuild) which is supposed to help with this type of issues except it didn't do it for me. With cmake in Eclipse all include paths are supposed to be discovered automatically, I suspect that is the reason the option to configure include paths is missing from cmake projects. |
Beta Was this translation helpful? Give feedback.
-
same problem =( |
Beta Was this translation helpful? Give feedback.
-
Please give the new language server based editor a try. It can be used for cmake projects since the language server, like clangd, resolves the includes based on a |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm using
++++++++++++++
Eclipse IDE for C/C++ Developers (includes Incubating components)
Version: 2023-09 (4.29.0)
Build id: 20230907-1323
OS: Linux, v.6.2.0-33-generic, x86_64 / gtk 3.24.33
Java vendor: Eclipse Adoptium
Java runtime version: 17.0.8.1+1
Java version: 17.0.8.1
++++++++++++++
and have the problem that the default "Hello World" code reports the "Symbol 'cout' could not be resolved".
I can build the project without errors
++++++++++++++++++++++++++
Configuring in: /home/llist/sec1/eclipseWorkspace/Test1/build/default
cmake -G Unix Makefiles -DCMAKE_EXPORT_COMPILE_COMMANDS=ON /home/llist/sec1/eclipseWorkspace/Test1
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/llist/sec1/eclipseWorkspace/Test1/build/default
Building in: /home/llist/sec1/eclipseWorkspace/Test1/build/default
cmake --build . --target all
[ 50%] Building CXX object CMakeFiles/Test1.dir/Test1.cpp.o
[100%] Linking CXX executable Test1
[100%] Built target Test1
Build complete (0 errors, 0 warnings): /home/llist/sec1/eclipseWorkspace/Test1/build/default
++++++++++++++++++++++++++
and when I run it I get
+++++++++++++++++++++++
Hello World
Version 0.1
+++++++++++++++++++++++
but the editor still show unresolved symbol references.
Most suggested solution suggest to modify/add the include path for the Project, but there is no option that I can find.
Thanks,
Leo
Beta Was this translation helpful? Give feedback.
All reactions