External library includes not resolved (sometimes) in project generated from cmakehttps://www.eclipse.org/forums/index.php/mv/msg/469613/1033418/#msg_1033418
I'm using Eclipse 4.2.2 and CDT 8.1.2.201302132326

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:

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

add_definitions(-D__GXX_EXPERIMENTAL_CXX0X__)

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

-std=c++0x

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?

Thanks]]>Enis Bayramoglu2013-04-04T08:03:46-00:00Re: External library includes not resolved (sometimes) in project generated from cmakehttps://www.eclipse.org/forums/index.php/mv/msg/469613/1033446/#msg_1033446
Just like in step 4 above where I add "-std=c++0x" into the "Command to get compiler specs" field, I also add "-I{include folder}" for each external library location manually. That solves the problem but it is very dirty, and I would like to know why the problem occurs in the first place. It's clearly a bug since the problem manifests itself after an Eclipse restart. It's also curious that the include folders are visible in the project explorer but the include files inside them are not resolved.]]>Enis Bayramoglu2013-04-04T08:29:04-00:00Re: External library includes not resolved (sometimes) in project generated from cmakehttps://www.eclipse.org/forums/index.php/mv/msg/469613/1033962/#msg_1033962
https://bugs.eclipse.org against CDT, describe the problem and attach .project and .cproject files? Please, also mention which version of CDT you are running.