I just installed Eclipse
CDT
with MinGW
.
All the environment variables are set, includes, etc. Tried running a hello world and everyth
Set ${COMMAND}
to gcc
on Linux
Under "Preprocessor Include Paths, Macros, etc." and "CDT GCC Built-in Compiler Settings" there is an undefined ${COMMAND}
variable if you imported the sources from an existing Makefile project.
Eclipse tries to run that command to parse its stdout to find headers, but ${COMMAND}
is not set by default, and so it is not able to do so.
I have explained this in more detail at: "Unresolved inclusion" error with Eclipse CDT for C standard library headers
I was having the same error and I fixed it by right clicking on your project, hover over the index tab and click Rebuild. My errors went away after that.
I was looking for answers here about this because I found out that CDT sometimes fails resolving the headers of the standard library. I still don't know why and how to reproduce the bug. Just restart CDT and all is solved.
I had the same problem: my makefile was running fine but I was getting errors like yours from the Eclipse CDT view.
I closed the current project, I opened a new "Makefile project with existing code" , specifying the right location source location of my project. After this, I checked that: right click project / C++ general / Paths and symbols / Gnu C++ / include directories is not empty and includes the correct paths of my project.
Then, I rebuilt the index (right click / index / rebuild).
Also, I use Eclipse CDT 7 and not Eclipse CDT 8 because CDT8 sometimes gives me compile errors from the GUI that I could not solve, eventhough the makefile was fine.
As Bob mentioned, i fix the bug just by rebuilt the index
NULL defined in stddef.h
, but stddef.h
is in xxx/include/linux
not xxx/include
-> even though you have added MingW's xxx/include
, still can not found NULL
add your MingW's include/linux
path to your project
(1) example of my xscale crosscompiler's include/linux
path is: /opt/crosscompile/xscale/gcc-4.6.0-glibc-2.9/arm-xscale-linux-gnueabi/sysroot/usr/include/linux
(2) my post:Ubuntu Eclipse: Symbol ‘NULL’ could not be resolved