0

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?

Nav
  • 19,885
  • 27
  • 92
  • 135

1 Answers1

1

I had similar problem and it was caused by the indexer not using the correct build configuration. By default, the indexer was set to use global settings, rather than project specific ones (I'm using Nsight, the version of Eclipse by Nvidia).

Go to

Project properties -> General -> Indexer

Tick

Enable project specific settings

Select

Use active build configuration

This might be irrelevant for you. I'm compiling the same project on multiple machines/OS's and hence have different include paths for each build configuration.

Tyson
  • 11
  • 1
  • Thank you for posting this. Hope it helps others too. I haven't been able to test it to see if this actually solves the problem, but when I confirm it, I'll respond. – Nav Aug 28 '13 at 16:54