title: Eclipse CDT with Cygwin GCC: automatic discovery of symbols and paths
body: <p>I am using Eclipse CDT with Cygwin GCC 3 as compiler. My project is using a custom Makefile.</p>
  
  <p>The problem is that when debugging the code, it couldn't locate the source files, even though I added a custom path mapping for: <code>/cygdrive/c &lt;-&gt; c:\</code></p>
  
  <p>That in addition to the fact that I am getting "<em>unresolved inclusion</em>" for all standard header files, even though the program compiles and run fine.</p>
  
  <p>I traced the problem to the "<em>automatic discovery</em>" option, which shows the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/4pU1e.png" alt="screenshot1"></p>
  
  <p>Note that I made  sure that the workspace directory is on a path without any spaces. The weird thing is that when I run that problematic command in the shell, it runs just fine with the following output:</p>
  
  <pre><code>$ gcc -E -P -v -dD C:/Users/Amro/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c
  Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
  Configured with: /managed/gcc-build/final-v3-bootstrap/gcc-3.4.4-999/configure --verbose --program-suffix=-3 --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext --enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchronization --enable-libstdcxx-debug
  Thread model: posix
  gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
   /usr/lib/gcc/i686-pc-cygwin/3.4.4/cc1.exe -E -quiet -v -P -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/../../include/w32api C:/Users/Amro/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c -mtune=pentiumpro -dD
  ignoring nonexistent directory "/usr/local/include"
  ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/include"
  ignoring duplicate directory "/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/../../include/w32api"
  #include "..." search starts here:
  #include &lt;...&gt; search starts here:
   /usr/lib/gcc/i686-pc-cygwin/3.4.4/include
   /usr/include
   /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api
  End of search list.
  #define __STDC_HOSTED__ 1
  #define __GNUC__ 3
         [.... truncated ....]
  #define __unix__ 1
  #define __unix 1
  </code></pre>
  
  <p>I also tried to manually add to the include path:</p>
  
  <p><img src="https://i.stack.imgur.com/dYFJr.png" alt="screenshot2"></p>
  
  <p>How can I fix this so that it discovers both the include paths and the defined symbols? Should I try turn off the auto discovery and hardcode the required paths in the <strong>.cproject</strong> file? Any help is appreciated (I only ask that you don't suggest using MinGW instead of Cygwin!)</p>