Skip to main content



      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
Eclipse UserFriend
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] by 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
Eclipse UserFriend
Can you compile your project in Eclipse?
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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 18:31 Go to previous messageGo to next message
Eclipse UserFriend
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] Tue, 20 February 2018 19:31 Go to previous messageGo to next message
Eclipse UserFriend
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 13:24 Go to previous message
Eclipse UserFriend
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: Wed Jul 02 00:45:48 EDT 2025

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

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

Back to the top