| External library includes not resolved (sometimes) in project generated from cmake [message #1033418]
||Thu, 04 April 2013 08:03
| Enis Bayramoglu
Registered: July 2009
I'm using Eclipse 4.2.2 and CDT 126.96.36.199302132326
I'm having a little issue with CDT; I have a moderately complicated cmake project that I would like to work on using CDT. I use the following command to generate an Eclipse project:
cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -DCMAKE_BUILD_TYPE=RelWithDebInfo ../src/
Then in Eclipse I import the project as usual. Initially I had some issues in getting the C++11 standard library symbols to be resolved, but I seem to have solved it now.
In summary, (In case it's relevant)
- I've added
to the CMakeLists.txt before using the cmake command.
- In Eclipse I've gone to the project properties and under "C/C++ General"->"Preprocessor Include Paths, Macros etc."->"Providers(Tab)" and I've "Enabled language settings providers for this project".
- Then I've chosen "CDT GCC Built-in Compiler Settings"
- Then I've added into the "Command to get compiler specs" field.
- I've pressed Apply, closed the dialog and rebuilt the index.
At this point, my Eclipse CDT setup works perfectly. Everything is indexed, CODAN is reporting no spurious errors and I have a dream development environment.
Sadly, that's not the end of the story. Changing nothing, when I restart Eclipse, CDT stops resolving all the include files except for those in the standard library. It's as if no external include folder is provided. Strangely enough, those include folders are still visible under the "includes" node in the project explorer. However, they're now gone from the "Properties"->"C/C++ General->Preprocessor Include Paths, Macros etc."->"Entries->GNU C++"->"CDT GCC Built-in Compiler Settings" list. Only the standard include paths are shown there.
I've tried many things like disabling language settings providers, re-enabling it and rebuilding the index, re-resolving includes and numerous other things to get CDT to see those folders again, but the only thing that seems to work is to remove the project from Eclipse, wipe all the files generated by cmake, re-create the project from scratch and import it back. Obviously, that works until the next restart of Eclipse.
Do I need to live with recreating the project and re-applying the steps I've described above every time I restart Eclipse? or is there a way to get CDT to resolve includes in folders that it already sees in the "Project Explorer" view?
Powered by FUDForum
. Page generated in 0.01556 seconds