Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Unresolved inclusion: <iostream>
Unresolved inclusion: <iostream> [message #638389] Thu, 11 November 2010 02:40 Go to next message
No real name is currently offline No real name
Messages: 1
Registered: November 2010
Junior Member
I have installed CygWin with all the necessary packages, and Eclipse with CDT, and I'm trying my hand at some C++ ...

Now I got this little program from http://www.cprogramming.com/tutorial/lesson2.html

#include <iostream>	

using namespace std;
		
int main()                            // Most important part of the program!
{
  int age;                            // Need a variable...
  
  cout<<"Please input your age: ";    // Asks for age
  cin>> age;                          // The input is put in age
  cin.ignore();                       // Throw away enter
  if ( age < 100 ) {                  // If the age is less than 100
     cout<<"You are pretty young!\n"; // Just to show you it works...
  }
  else if ( age == 100 ) {            // I use else just to show an example 
     cout<<"You are old\n";           // Just to show you it works...
  }
  else {
    cout<<"You are really old\n";     // Executed if no other statement is
  }
  cin.get();
}


Eclipse underlines
#include <iostream>
and says
Quote:
Unresolved inclusion: <iostream>
.

Now what?

EDIT: PS: It compiles and runs in Notepad++, where I use my own compile script.

[Updated on: Thu, 11 November 2010 05:32]

Report message to a moderator

Re: Unresolved inclusion: <iostream> [message #639064 is a reply to message #638389] Mon, 15 November 2010 03:05 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Can you compile your project in Eclipse?

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Unresolved inclusion: <iostream> [message #640270 is a reply to message #639064] Fri, 19 November 2010 15:26 Go to previous messageGo to next message
Fellkneul  is currently offline Fellkneul
Messages: 1
Registered: November 2010
Junior Member
I used to have the same problem when I started to work with eclipse cdt and msys+mingw. Try to check whether you have your project's include paths set correctly.
Re: Unresolved inclusion: <iostream> [message #640354 is a reply to message #640270] Sat, 20 November 2010 21:30 Go to previous messageGo to next message
Marc-Andre Laperle is currently offline Marc-Andre Laperle
Messages: 171
Registered: July 2009
Senior Member
Maybe CDT can't find Cygwin. Which version of CDT are you using? Do you see Cygwin in the toolchains in the New project wizard? (without unchecking the checkbox at the bottom). There is a section in the Wiki FAQ explaining how CDT looks for Cygwin, here.

BTW, CDT works best with MinGW and the easiest way to use CDT on Windows is by downloading Wascana.
Re: Unresolved inclusion: <iostream> [message #648212 is a reply to message #640354] Tue, 11 January 2011 14:31 Go to previous messageGo to next message
Don Marquardt is currently offline Don Marquardt
Messages: 1
Registered: January 2011
Junior Member
Hi:

New to eclipse C++ IDE and I am having the same problem. I loaded the latest version of wascana 1.0 and Mingw toolsand the Helios Eclipse from the wascana web site...

http://code.google.com/a/eclipselabs.org/p/wascana/downloads /detail?name=wascana-1.0-setup.exe

Both Mingw and Cygwin GCC show in the tool chain in the project wizard.

Suggestions apreciated.

Thanks

Don
Re: Unresolved inclusion: <iostream> [message #657331 is a reply to message #648212] Wed, 02 March 2011 08:32 Go to previous messageGo to next message
Yoram  is currently offline Yoram
Messages: 1
Registered: March 2011
Junior Member
I use Eclipse Helios and MingW and had the same issue.
What solved my problem was adding "C:\dev\eclipse\mingw\lib\gcc\mingw32\4.4.1-dw2\include\c++" to the include paths in Eclipse:
1. Right-click on the probject and select "Properties"
2. Go to "C/C++ General" -> "Paths and Symbols" and select "Includes" tab
3. Select "GNU C++"
4. Press on "Add..."
5. Look for the folder "C:\dev\eclipse\mingw\lib\gcc\mingw32\4.4.1-dw2\include\c++" or similar (I searched for the file "iostream" under c:\dev\eclipse\mingw and found it under that folder)

That's it.

Note that as far as I understand this needs to be done for every project seperately.
Re: Unresolved inclusion: <iostream> [message #1042561 is a reply to message #657331] Tue, 16 April 2013 11:22 Go to previous message
katie evans is currently offline katie evans
Messages: 28
Registered: July 2012
Location: brisbane queensland austr...
Junior Member
An alternative solution would be:

Right click on project->

Preprozessor Includes ->


Go to tab "Providers"

Select/activate "CDT GCC Built-in Compiler Settings"


Then in the previous tab "Entries" a respective entry appears.
Previous Topic:C/C++ perspective is absent in JUNO CDT.
Next Topic:how to debug libtool generated executable using CDT
Goto Forum:
  


Current Time: Fri Jul 25 12:15:32 EDT 2014

Powered by FUDForum. Page generated in 0.15864 seconds