title: Eclipse-CDT: Automatic Path Discovery when cross-compiling for Linux under Windows
body: <p>I'm using Eclipse-CDT to develop and compile projects for Linux. As host both Linux or Windows may be used.</p>
  
  <p>The project is created as Makefile project with a special build command, so I changed the build-command from <code>make</code> to our special one and the "Build" and "Clean" commandline approbriately. The build command uses a gcc from a directory not in <code>$PATH</code>, because the whole compiler-suite is located in the version control system. (Correct <code>$PATH</code> is set by the build command.)</p>
  
  <p>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.</p>
  
  <p>When I have a look in the generated MyProject.sc file in the <code>workspace/.metadata/.plugins/org.eclipse.cdt.make.core</code> directory, I see that the Include-Files are recognized, but prepended with a <code>C:\cygwin</code>.</p>
  
  <p>The GCC command line uses absolute paths without the Drive letter.
  (The whole source tree is located on a special Drive (e.g. <code>W:</code>), CWD is on this drive ).
  E.g. <code>gcc</code>/<code>g++</code> is invoked with <code>-I /net_libs/lib1/inc</code> and Eclipse recognizes <code>C:\cygwin\net_libs\lib1\inc</code>.</p>
  
  <p>BTW: The standard-include paths are recognized correctly (e.g. <code>W:/toolchain/win32/i686-pc-linux-gnu/include/c++/4.2.1</code>).</p>
  
  <p>The Build-Directory is set to the directory of the Makefile which is on the same Drive as the Sources and Includes.</p>
  
  <p>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).</p>
  
  <p>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.</p>
  
  <p>When I change the .sc file manually and correct the paths and restart Eclipse, everything works fine.</p>
  
  <p>Do you have any hints what may be the problem?</p>