문제

I am using Eclipse (Kepler) with the CDT (8.2.1) plugin for C++ development. My problem is that when I create a new class (New->Class) the default include in the X.cpp file which should be #include "X.h" actually is #include "C:X.h". The same thing happens when I use the 'Organize Includes' function of CDT.

I was unable to find the reason for this behaviour. I would be really grateful if anyone could help me with this issue.

도움이 되었습니까?

해결책

I had this problem too, I had created a new empty C++ project. then created my src folder and started adding classes and folders as normal. The solution i found was to set up the C++ include paths.

For those who do not know how to do that what i did was : make sure your open project is selected in eclipse go to : "project" > "properties" > "C/C++ Build" > "Settings"

Then add include paths within "GCC C++ Compiler" > "Includes"

I am using workspace relative paths so i need this entry to exist: "${workspace_loc:/${ProjName}/src}"

Then beyond that add any other folders you need to access header files within.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top