views:

195

answers:

1

I'm using Eclipse-CDT to develop and compile projects for Linux. As host both Linux or Windows may be used.

The project is created as Makefile project with a special build command, so I changed the build-command from make to our special one and the "Build" and "Clean" commandline approbriately. The build command uses a gcc from a directory not in $PATH, because the whole compiler-suite is located in the version control system. (Correct $PATH is set by the build command.)

This works fine under Linux: Eclipse learns the Symbols and Include Files automatically. However, under Windows the Symbols are recognized, but the Include Paths aren't.

When I have a look in the generated MyProject.sc file in the workspace/.metadata/.plugins/org.eclipse.cdt.make.core directory, I see that the Include-Files are recognized, but prepended with a C:\cygwin.

The GCC command line uses absolute paths without the Drive letter. (The whole source tree is located on a special Drive (e.g. W:), CWD is on this drive ). E.g. gcc/g++ is invoked with -I /net_libs/lib1/inc and Eclipse recognizes C:\cygwin\net_libs\lib1\inc.

BTW: The standard-include paths are recognized correctly (e.g. W:/toolchain/win32/i686-pc-linux-gnu/include/c++/4.2.1).

The Build-Directory is set to the directory of the Makefile which is on the same Drive as the Sources and Includes.

I tried various "Toolchain" settings (Cygwin, MinGw, Linux gcc), the result is same every time. (After changing the settings, I even stopped Eclipse, deleted the sc file and started Eclipse again).

I don't know why Eclipse knows about my Cygwin installation in C:\Cygwin - the installation is NOT used by the compiler or related tools.

When I change the .sc file manually and correct the paths and restart Eclipse, everything works fine.

Do you have any hints what may be the problem?

A: 

Have a look at Project->Propterties->C/C++ Build->Discovery Options.
There is a Compiler invocation command - usually set to gcc, which means "gcc in PATH". Try setting this to your gcc from your build system.

Turbo J
This option is only used to get the standard-include-paths - it is set to my toolchain-compiler and discovery works fine, these paths are recognized correctly.I think my problem has something to do with the (Cygwin) path mapping. I tried again on a Windows-PC where no Cygwin is installed and there Eclipse does not map / to C:\Cygwin - instead of this it does no mapping it all - and so does not recognize the include paths, too.
IanH