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] Fri, 20 December 2013 22:26 Go to next message
Daryl Lee is currently offline Daryl Lee
Messages: 5
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] Fri, 20 December 2013 23:57 Go to previous messageGo to next message
Daryl Lee is currently offline Daryl Lee
Messages: 5
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] Wed, 01 January 2014 20:32 Go to previous message
Chris Albertson is currently offline Chris Albertson
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: Mon Jul 28 00:28:56 EDT 2014

Powered by FUDForum. Page generated in 0.01561 seconds