[clug] sockets compiling advice

Martijn van Oosterhout kleptog at svana.org
Sat Jan 17 22:41:37 GMT 2004


I don't see anything immediately, but I'd try making it a C file and taking
out the "using namespace" bit.

I can't see any problem specifically, but it's something with C++. Do you
need to specify a library to get standard C++ programs to run?

Hope this helps,

On Sun, Jan 18, 2004 at 10:52:04AM +1100, 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
> -- 
-- 
Martijn van Oosterhout   <kleptog at svana.org>   http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20040118/ad2ea679/attachment.bin


More information about the linux mailing list