Summary: g++ problem - cout unresolved

From: Aharon Schkolnik <aharon_at_healdb.matat.health.gov.il>
Date: 22 Aug 1996 14:25:05 +0300

My original question:


>> Hi.
>>
>> I don't know anything about c++, so please bear with me.
>>
>> I'm trying to build the dxpc program (X compressor - sounds
>> interesting).
>>
>> Here'w what I get:
>>
>> healdb:dxpc-3.0beta1#gmake gcc -c -O -I/usr/X11R6/include
>> main.C gcc -c -O -I/usr/X11R6/include util.C gcc -c -O
>> -I/usr/X11R6/include constants.C gcc -c -O -I/usr/X11R6/include
>> Stats.C gcc -c -O -I/usr/X11R6/include Multiplexer.C gcc -c -O
>> -I/usr/X11R6/include ClientMultiplexer.C gcc -c -O
>> -I/usr/X11R6/include ServerMultiplexer.C gcc -c -O
>> -I/usr/X11R6/include ClientChannel.C gcc -c -O
>> -I/usr/X11R6/include ServerChannel.C gcc -c -O
>> -I/usr/X11R6/include ReadBuffer.C gcc -c -O
>> -I/usr/X11R6/include ProxyReadBuffer.C gcc -c -O
>> -I/usr/X11R6/include ClientReadBuffer.C gcc -c -O
>> -I/usr/X11R6/include ServerReadBuffer.C gcc -c -O
>> -I/usr/X11R6/include EncodeBuffer.C gcc -c -O
>> -I/usr/X11R6/include DecodeBuffer.C gcc -c -O
>> -I/usr/X11R6/include WriteBuffer.C gcc -c -O
>> -I/usr/X11R6/include IntCache.C gcc -c -O -I/usr/X11R6/include
>> CharCache.C gcc -c -O -I/usr/X11R6/include PixelCache.C gcc -c
>> -O -I/usr/X11R6/include HuffmanCoder.C gcc -c -O
>> -I/usr/X11R6/include ClientCache.C gcc -c -O
>> -I/usr/X11R6/include ServerCache.C gcc -c -O
>> -I/usr/X11R6/include TextCompressor.C gcc -c -O
>> -I/usr/X11R6/include LastPixels.C gcc -c -O
>> -I/usr/X11R6/include SequenceNumQueue.C gcc -c -O
>> -I/usr/X11R6/include BlockCache.C gcc -c -O
>> -I/usr/X11R6/include BlockCacheSet.C gcc -O
>> -I/usr/X11R6/include -o dxpc main.o util.o constants.o Stats.o
>> Multiplexe r.o ClientMultiplexer.o ServerMultiplexer.o
>> ClientChannel.o ServerChannel.o Read Buffer.o ProxyReadBuffer.o
>> ClientReadBuffer.o ServerReadBuffer.o EncodeBuffer.o
>> DecodeBuffer.o WriteBuffer.o IntCache.o CharCache.o
>> PixelCache.o HuffmanCoder.o ClientCache.o ServerCache.o
>> TextCompressor.o LastPixels.o SequenceNumQueue.o Blo ckCache.o
>> BlockCacheSet.o collect2: ld returned 1 exit status
>> /usr/bin/ld: Unresolved: cout ostream::operator<<(char const *)
>> endl(ostream &) cerr ostream::operator<<(int)
>> ostream::operator<<(unsigned long) ostream::operator<<(unsigned
>> int) ostream::operator<<(char) ostream::operator<<(double)
>> ostream::operator<<(long) gmake: *** [dxpc] Error 1
>>
>> Now, I don't understand that stuff at the end, but it looks
>> like the loader is trying to find a module with the name
>> cout. Now, isn't cout a c++ built-in ?
>>
>> Anyway, can anyone help me out here ?
>>
>> TIA.



The solution: use g++ instead of gcc.

>>>>> "Olle" == Olle Eriksson <olle_at_cb.uu.se> writes:

    Olle> To link C++ code the g++ command, not the gcc commmand
    Olle> should be used. gcc don't know about the g++-libraries
    Olle> necessary to link any C++-program.

    Olle> Thus gcc can compile C++ code but not link it, g++ does
    Olle> both.



Thanks also to:

Henrik Sloth <hs_at_dksin.dk> writes:



This list is amazing !


--
  The day is short, and the work is great,     |   Aharon Schkolnik
  and the laborers are lazy, and the reward    |   Aharon_at_Matat.Health.Gov.IL
  is great, and the Master of the house is     |
  impatient. - Ethics Of The Fathers Ch. 2     |
Received on Thu Aug 22 1996 - 13:58:11 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:47 NZDT