Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » OSX Hello World(cout & std are not resolved)
OSX Hello World [message #689123] Sun, 26 June 2011 22:12 Go to next message
Peter Walker is currently offline Peter WalkerFriend
Messages: 7
Registered: June 2011
Junior Member
I am new to Eclipse. Having worked with XCode in C++, I believe all necessary developer tools are installed. I downloaded the MacOSX 64 bit version of Eclipse. I have tested gcc in terminal. I cannot get the canned hello world project to compile. cout and std are not resolved. However if I comment out the std & cout lines, a program in which variable i is incremented will run. The compile error is given as:
Symbol 'cout' could not be resolved
Symbol 'std' could not be resolved

Any help would be appreciated. Details are given below.

Thanks.

Peter Walker
-------------------------
Hardware & OSX details
OSX 10.6.7
Model Name: MacBook Pro
Processor Name: Intel Core i7
Processor Speed: 2.8 GHz
Number Of Processors: 1
Total Number Of Cores: 2

-------------------------
Eclipse Details:

Version: Indigo Release
Build id: 20110615-0604
-------------------------
Hello World Details


#include <iostream>
using namespace std;

int main() {
int i=1;
i++;
cout << "!!!Hello World!!!";
return i;
}
-----------------------
Problem view details

Description Resource Path Location Type
Symbol 'cout' could not be resolved Hello World.cpp /Hello World/src line 15 Semantic Error
Symbol 'std' could not be resolved Hello World.cpp /Hello World/src line 10 Semantic Error


-----------------------
iostream details: note ? replaces slash in the text below because links are not allowed....

#pragma GCC system_header

#include <bits/c++config.h>
#include <ostream>
#include <istream>

_GLIBCXX_BEGIN_NAMESPACE(std)

?**
* @name Standard Stream Objects
*
* The &lt;iostream&gt; header declares the eight <em>standard stream
* objects</em>. For other declarations, see
* http:??gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#10 and the
* @link s27_2_iosfwd I/O forward declarations @endlink
*
* They are required by default to cooperate with the global C library's
* @c FILE streams, and to be available during program startup and
* termination. For more information, see the HOWTO linked to above.
*?
??@{
extern istream cin; ???< Linked to standard input
extern ostream cout; ???< Linked to standard output
extern ostream cerr; ???< Linked to standard error (unbuffered)
extern ostream clog; ???< Linked to standard error (buffered)

#ifdef _GLIBCXX_USE_WCHAR_T
extern wistream wcin; ???< Linked to standard input
extern wostream wcout; ???< Linked to standard output
extern wostream wcerr; ???< Linked to standard error (unbuffered)
extern wostream wclog; ???< Linked to standard error (buffered)
#endif
??@}

?? For construction of filebuffers for cout, c........ <<code continues>>
Re: OSX Hello World [message #695169 is a reply to message #689123] Mon, 11 July 2011 07:37 Go to previous messageGo to next message
Arthur Mitrano is currently offline Arthur MitranoFriend
Messages: 1
Registered: July 2011
Junior Member
Hello there. I'm having the same problem.

On the Problems view it says:

Symbol 'cout' could not be resolved
Symbol 'std' could not be resolved


I'm trying to run the basic Hello World program.

I'm just testing Eclipse to see if it is good for C++ too. I used it for Java a couple years ago and I love the editor stuff. However, I'm having issues with the versions for C++ and Fortran.

I know Fortran and I'm trying to learn C++. Does anybody recommend a different IDE for C++ or Fortran?

Just a quick note I'm doing this on Windows using MinGW.
Re: OSX Hello World [message #695945 is a reply to message #689123] Tue, 12 July 2011 22:03 Go to previous messageGo to next message
CGO SenseiC is currently offline CGO SenseiCFriend
Messages: 16
Registered: July 2011
Junior Member
Well I had (past tense) the identical problem on my Win7 x64 box... until a few minutes ago...

Not sure WHICH resolved it, but I downloaded the NEWEST Eclipse Indigo CDT (as in newer than what I downloaded a week or two ago)... and I also updated Java from 1.6.0_24 to 1.6.0_25. One of the two of those (or both) seems to have resolved it... because I just launched CDT and created a new C++ "Hello World" (which failed an hour ago) and it compiled w/o a hitch.

SenseiC bows out
Re: OSX Hello World [message #734473 is a reply to message #689123] Fri, 07 October 2011 22:28 Go to previous message
Alancui  is currently offline Alancui Friend
Messages: 1
Registered: October 2011
Junior Member
I faced the same problem today and I think it could be related with C++ Compiler. So, I downloaded Dev-C++ and created the same .cpp project. After compile and execute, the problem has been solved. You can try.

Afterwards, I consider how to linked Dev-C++ compiler with Eclipse together, may add preferences.

Let's discuss!
Previous Topic:Stumped by indexer!
Next Topic:missing debug info for libraries
Goto Forum:
  


Current Time: Fri Apr 26 23:23:17 GMT 2024

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

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

Back to the top