Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » HelloWorld.cpp fails on Juno/Mac(namespace std is not found on first attempt to compile C++ file.)
HelloWorld.cpp fails on Juno/Mac [message #1222682] Sat, 21 December 2013 03:26 Go to next message
Daryl Lee is currently offline Daryl LeeFriend
Messages: 8
Registered: April 2011
Junior Member
I just installed CDT from http://download.eclipse.org/tools/cdt/releases/juno onto Juno (Version: Juno Service Release 2 Build id: 20130225-0426) on Mac OSX 10.9.1. HelloWorld.c built just fine, but HelloWorld.cpp fails to find namespace std; I get no error on the #include <iostream> line, but the next line, using namespace std;, fails to resolve std and similarly for the references to cout and endl. I was careful to select "MAC OSX GC" as the toolchain. When I compile from the command line (g++ HelloWorld.cpp) it compiles just fine.

Might I have omitted something in the installation or configuration?
Re: HelloWorld.cpp fails on Juno/Mac [message #1222702 is a reply to message #1222682] Sat, 21 December 2013 04:57 Go to previous messageGo to next message
Daryl Lee is currently offline Daryl LeeFriend
Messages: 8
Registered: April 2011
Junior Member
More information. I added /usr/local/include/c++/4.9.0 to the include path. This does not solve the problem with the editor reporting that std, cout, and endl are not resolved, but the project does build and execute as it should. So the problem appears to be in the editor's not recognizing the #include, which is very surprising to me.
Re: HelloWorld.cpp fails on Juno/Mac [message #1226526 is a reply to message #1222702] Thu, 02 January 2014 01:32 Go to previous message
Chris Albertson is currently offline Chris AlbertsonFriend
Messages: 3
Registered: January 2014
Location: So. California
Junior Member
I'm still learning how to search this forum so just a few minutes ago I posted the exact same problem. I'm also on Mac OS X 10..9.1

It looks like this is a reproducible bug and not just something odd about your system.
Previous Topic:Eclipse shows errors in "Hello World" Compiler does not
Next Topic:Include paths and Kepler (on Windows)
Goto Forum:
  


Current Time: Fri Mar 29 12:03:43 GMT 2024

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

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

Back to the top