Eclipse CDT "Symbol NULL could not be resolved"

Alex picture Alex · Sep 15, 2011 · Viewed 82.8k times · Source

I just installed Eclipse CDT with MinGW. All the environment variables are set, includes, etc. Tried running a hello world and everything seems to be fine.

I tried loading a C project that I had before in my computer, it seems to load everything fine, yet I get the following error with the NULL symbol :

Symbol 'NULL' could not be resolved

Any insights? Thanks!

Answer

Man Vs Code picture Man Vs Code · Sep 15, 2011

NULL is usually defined in stddef.h. This file is also usually included with stdlib.h and stdio.h.

And, you could always do this:

#ifndef NULL
#define NULL   ((void *) 0)
#endif