Skip to main content


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 07:40 Go to next message
No real name is currently offline No real nameFriend
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 10:32]

Report message to a moderator

Re: Unresolved inclusion: <iostream> [message #639064 is a reply to message #638389] Mon, 15 November 2010 08:05 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
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 20:26 Go to previous messageGo to next message
Fellkneul  is currently offline Fellkneul Friend
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] Sun, 21 November 2010 02:30 Go to previous messageGo to next message
Marc-André Laperle is currently offline Marc-André LaperleFriend
Messages: 252
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 19:31 Go to previous messageGo to next message
Don Marquardt is currently offline Don MarquardtFriend
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 13:32 Go to previous messageGo to next message
Yoram  is currently offline Yoram Friend
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 15:22 Go to previous messageGo to next message
katie evans is currently offline katie evansFriend
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.
Re: Unresolved inclusion: <iostream> [message #1566569 is a reply to message #1042561] Thu, 15 January 2015 23:31 Go to previous messageGo to next message
tolani jayt is currently offline tolani jaytFriend
Messages: 1
Registered: January 2015
Junior Member
I could not find the preProcessor Includes under the C/C++ General. Please any suggestion would help
Re: Unresolved inclusion: <iostream> [message #1782255 is a reply to message #1566569] Wed, 21 February 2018 00:31 Go to previous messageGo to next message
Clark Thomborson is currently offline Clark ThomborsonFriend
Messages: 1
Registered: February 2018
Junior Member
index.php/fa/32145/0/I had a very similar problem with a clean install of Eclipse using Oomph on my Win10 box. A compile & run of helloworld in Release worked fine. A compile in Debug produced an exe which I could debug by calling gdb within a cygwin console; but gdb would fail during its launch by Eclipse. My fix: I edited the Path environment variable of my Win10 OS, using Control Panel/System, to include C:/cygwin64/bin.

Another difficulty I had with the default Oomph installation was that it set C:/Users/myname/eclipse-workspace/ as my default workspace. That's a nightmarish place for a workspace of a cygwin project! Fix: I use a workspace in my cygwin/home directory. I'm still fiddling with a source-file Path Mapping in Debug/Configuration, for it seems that gdb (when launched from Eclipse) can't find the sourcefiles on a WIndows box until you give it some additional help with the Unix(cygwin)->Windows translation. Something like /home/myname/workspace -> C:\cygwin64\home\myname\workspace should work, but I haven't tested it fully so YMMV.
Re: Unresolved inclusion: <iostream> [message #1787098 is a reply to message #1042561] Fri, 18 May 2018 17:24 Go to previous message
Brian Hoblin is currently offline Brian HoblinFriend
Messages: 1
Registered: May 2018
Junior Member
Thanks! In 2018 this is still working for both my C and C++ codes (Version: Oxygen.3a Release (4.7.3a) on Ubuntu)!
Previous Topic:graph data on Eclipse console window to our computer
Next Topic:Importing part of huge code base into eclipse/oxygen
Goto Forum:
  


Current Time: Mon Oct 22 18:37:52 GMT 2018

Powered by FUDForum. Page generated in 0.08816 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top