This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compilation/linking problems with 2.95.3 & 3.1


Rexford Gibbs <herk@cwnet.com> writes:

> Hi, gcc-help.
> 
> The precompiled binary version of gcc-2.95.3 that comes with the
> Solaris8 for Intel CD set
> won't compile a simple C++ 'Hello, world' test:  the following error
> message is produced:
> 
> Undefined                                                    first
> encountered
> symbol                                                         in file
> cout
> /var/tmp/ccEiizXe.o
> ostream::operator ....etc
> ld: fatal: Symbol referencing errors.
> collect 2: ld returned 1 exit status
> 
> Is it that the STL can't be found, or that it's not installed, or some
> other problem?
> I'd appreciate any help or suggestions.

What commands you use, exactly?

Usually, the above message indicates that you didn't tell to the
linker to use the standard C++ library file. As a rule of thumb, use
'g++' to compile/link C++ code, it adds the necessary standard
libraries automatically:

> g++ hello_world.cpp -o hello

> ./hello

"hello, wordl!"

-- 
Oscar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]