Standard system include paths missing in Eclipse from catkin_make
PROBLEM:
When I use catkin_make to create the Eclipse project files, it does not include some standard system dependencies in the Include Paths, namely:
- /usr/include/c++/4.6
- /usr/include/c++/4.6/x86_64-linux-gnu
- /usr/include/c++/4.6/backward
SPECIFICS:
I run
$ catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles"
and import the project in Eclipse from the build directory. (see http://answers.ros.org/question/52013/catkin-and-eclipse/ (catkin and eclipse))
When I import the project in Eclipse, it is missing the above includes, which causes it to complain about - namely, among other things - "Unresolved include of #include < string >"
This in turn propagates errors of "Type std::string could not be resolved"
The package builds just fine, which means the compiler can resolve all required includes, this is just a problem in using Eclipse effectively.
QUESTION: Is there a way to have catkin build the Eclipse project files with those includes?
(SPECS: Groovy on Ubuntu 12.04)
I think this is more of a question about CMake. If you make a simple CMake project and give it the -G"Eclipse.... argument are the include paths set correctly? If they are then we might need to look into why catkin is different, but otherwise I think this is a general CMake question.
William, that set me on the right path. To work around my current problem, I added following two lines in my CMakeLists.txt: SET(STANDARD_INCLUDE_DIRS "/usr/lib/gcc/x86_64-linux-gnu/4.6/include; /usr/(...etc) ) include_directories(include ${STANDARD_INCLUDE_DIRS} ) There must be a more-correct way.
So while this is an issue with CMake, it still feels like the auto-generated CMakeLists.txt files should have rules that account for this. The package has no problem building, so the directories are obviously included and linked properly, they just don't export to the eclipse project files.
FWIW I ran into the exact same issue (on 12.04 + groovy + catkin) before. It seems it is somehow related to catkin. Other cmake eclipse projects (in my case from rosbuild packages) work just fine without any special handling of the above include paths.
I'm not sure why, but as of yesterday this issue was resolved for me. All expected include paths were present in the project settings. Anyone have any insights?