This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: compilation/linking problems with 2.95.3 & 3.1
- From: Oscar Fuentes <ofv at wanadoo dot es>
- To: Rexford Gibbs <herk at cwnet dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 21 Jun 2002 23:22:17 +0200
- Subject: Re: compilation/linking problems with 2.95.3 & 3.1
- References: <3D13821C.4040704@cwnet.com>
- Reply-to: gcc-help at gcc dot gnu dot org
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