[clug] sockets compiling advice

Adrian Blake adrianb at ise.canberra.edu.au
Sun Jan 18 03:12:34 GMT 2004


Thank all for your replies, it works, and works well. I also got good 
advice from http://www.advancedlinuxprogramming.com

Adrian

Michael Cohen wrote:
> Adrian,
>    This source is in c++ so its best to use the g++ compiler like:
> 
>    g++ -Wall -g p10.6.cxx
> 
>    It will warn about a redefine of _GNU_SOURCE, you should probably put that 
> inside an ifdef.
> 
> Michael.
> 
> On Sun, 18 Jan 2004 10:52 am, Adrian Blake wrote:
> 
>>I have cut & pasted some code from a book but have trouble compiling.
>>The following are the messages:
>>
>>gcc p10.6.cxx  -o p10.6 -Wall -g
>>In file included from p10.6.cxx:4:
>>local_sock.h:6:1: warning: "_GNU_SOURCE" redefined
>>p10.6.cxx:1:1: warning: this is the location of the previous definition
>>/tmp/ccbmWDOI.o: In function `__static_initialization_and_destruction_0':
>>/usr/include/c++/3.2/iostream:62: undefined reference to
>>`std::ios_base::Init::Init[in-charge]()'
>>/tmp/ccbmWDOI.o: In function `__tcf_0':
>>/usr/include/c++/3.2/iostream:62: undefined reference to
>>`std::ios_base::Init::~Init [in-charge]()'
>>/tmp/ccbmWDOI.o: In function `main':
>>/home/adrian/ipc/chapt_10/p10.6.cxx:15: undefined reference to
>>`__gxx_personality_v0'
>>collect2: ld returned 1 exit status
>>
>>The two source files are attached. Please advise me on what is required
>>to compile this correctly
>>
>>Adrian
> 
> 
> 


-- 
Adrian Blake
Research Assistant
University of Canberra
Ph 02 6201 2516 Mob 0407 232 978

also

Snowy Technology Pty Ltd
P.O. Box 57
Cooma, NSW 2630



More information about the linux mailing list