'Eclipse throwing "Unresolved inclusion error" on standard includes like "stdio.h"

After installing Eclipse freshly on Windows 10, I imported code to work on, but Eclipse started throwing the error "Unresolved inclusion error" on standard libraries like stdio.h and stdint.h. Does Eclipse not install standard libraries or a compiler?



Solution 1:[1]

The error was due to missing includes in general. It seems like Eclipse does not install a standard compiler for C/C++.

The issue was resolved with the following steps:

  1. Installing MinGW
  2. Adding the gcc and g++ to the PATH variable. Both of them were included in C:\MinGW\bin, since I did not change the installation path.
  3. I included all includes and header file paths of the project into Project -> Properties -> C/C++ Build -> Settings -> Cross GCC Compiler -> Includes.
  4. In the same include settings, I also added C:\MinGW\include, since thats the location of the standard include files for C/C++.
  5. Rebuilding the index with Project -> C/C++ Index -> Rebuild.

If the options described above with the Project menu are not available, make sure the project you're referring to is marked in the project explorer of Eclipse.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vandrey