"Unresolved inclusion" error with Eclipse CDT for C standard library headers

Go to Project > Properties > C/C++ General > Preprocessor Includes > Providers and select both:

  • "CDT GCC Built-in Compiler Settings"
  • "CDT CROSS GCC Built-in Compiler Settings"

For each one of those also select the sub-entry: "Use global provider shared between projects".

Tested on Eclipse 4.8.0 in Ubuntu 16.04 with a C and a C++ hello world.


just adding to the knowledge base, i just did this on win7 with cygwin.

this is what seems to work for me.

include paths for c:

D:\dev\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\include
D:\dev\cygwin\usr\include

include paths for c++:

D:\dev\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\include
D:\dev\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\include\c++
D:\dev\cygwin\usr\include

this gets me a clean compile of hello world.


I found these answers (including the accepted one) somewhat cryptic.

For me, I had to add the path where stdio.h is located (as @ardnew said). In Eclipse, you open the Properties of your project, expand "C/C++ General" and select "Paths and Symbols".

Make sure you have added the include dir for each language you are using. (In my case, I needed to just add it to GNU C++.)

Screenshot of Eclipse "Project Properties" dialog with "Paths and Symbols" selected. An "add directory path" dialog is overlaid.


The compiler Eclipse is using is able to resolve the symbols just fine, so the code will compile fine.

But the code-completion/indexer or preprocessor Eclipse is using doesn't know where stdio.h exists.

You need to specify the filesystem path where stdio.h is located.

The Eclipse documentation describes this in several sections for the compiler:

  • Adding include paths and symbols
  • C/C++ Project Properties, Paths and Symbols, Includes

And if the code-completion/indexer or preprocessor specifically also cannot locate stdio.h:

  • Setting up include paths and macros for C/C++ indexer
  • C/C++ Project properties: Preprocessor Include Paths, Macros, etc.

The exact location of stdio.h will depend on the system you are intending to write the code for. If you are writing code for the same system you are running Eclipse on, then the standard location is /usr/include/stdio.h for Linux, macOS, Cygwin, etc.

If you are cross-compiling for a separate/remote target system (e.g. Android, Raspberry Pi, STM32), then it will be located somewhere in the SDK you installed for that system. You will need to refer to that particular SDK documentation.