I'm using the latest 32bit Eclipse Juno. I've seen many posts about folder inclusion, but none worked for me.
The problem:
#include<iostream>
#include<osgDB/ReadFile>
#include<osgViewer/Viewer>
The compiler (GCC) reports "unresolved inclusion <iostream>"
and corresponding unresolved inclusion errors for ReadFile and Viewer.
What I tried, to solve it:
In Project properties > C/C++ General > Paths and symbols > Includes
. I added /usr/include/c++/4.4.4/
for all configurations
and all languages
. This automatically caused the values in C/C++ Build > Settings > GCC C compiler and GCC C++ compiler's includes > include paths
to contain the same values.
The unresolved inclusion error persisted.
Then I tried adding iostream
to the include files
section below the include paths
section. Still no use. Even tried closing and re-opening eclipse after the changes. Still no use.
The only other option was to specify the absolute path which worked:
#include "/home/nav/osg/osg/include/osgDB/ReadFile"
#include "/home/nav/osg/osg/include/osgViewer/Viewer"
#include "/usr/include/c++/4.4.4/iostream"
But isn't the right way to do it. Could anyone help with specifying the include paths the correct way?