How to solve "Unresolved inclusion: <iostream>" in a C++ file in Eclipse CDT?

  1. Click Project → Properties.
  2. Expand C/C++ General.
  3. Click Preprocessor Include Paths, Macros, etc.
  4. Click the Providers tab.
  5. Check CDT GCC Built-in Compiler Settings.
  6. Check Use global provider shared between projects. Preprocessor Properties
  7. Click Apply and Close.

I use Eclipse for cross compiling and I have to add the explicit directories for some of the standard C++ libraries. Right click your project and select Properties. You'll get the dialog shown in the image. Follow the image and use the + icon to explicitly add the paths to your C++ libraries. enter image description here


Make sure that your file has .cpp extension and not .c, I just had this problem