OSX Hello World [message #689123] |
Sun, 26 June 2011 18:12  |
Eclipse User |
|
|
|
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 <iostream> 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 #734473 is a reply to message #689123] |
Fri, 07 October 2011 18:28  |
Eclipse User |
|
|
|
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!
|
|
|
Powered by
FUDForum. Page generated in 0.09611 seconds