dermesser / libsocket

The ultimate socket library for C and C++, supporting TCP, UDP and Unix sockets (DGRAM and STREAM) on Linux, FreeBSD, Solaris. See also my uvco library for a refreshed version!
https://borgac.net/~lbo/doc/libsocket/
Other
806 stars 196 forks source link

Error while Linking on Ubuntu 14.04 #20

Open benjamin-lieser opened 9 years ago

benjamin-lieser commented 9 years ago

On my Ubuntu 14.04 I have installed this libaray without errors or warnings. in /urs/lib/ is the libsocket++.so file. But when I execute the test.sh in the examples++ directory, I get erros, like undefined relation on libsocket::unix_stream_server::unix_stream_server(std::string const&, int) or something like that. It seems that these funktions are not implementet in the libsecket++.so file.

benjamin-lieser commented 9 years ago

I have solves the problem the -lsocket++ Parameter must placed after the .cpp file. (I don´t know why, but so it´s work, it seems to be an ubuntu problem)

dermesser commented 9 years ago

Yeah, a good rule of thumb is to place linker arguments at the end of the command line. Can I close this?

benjamin-lieser commented 9 years ago

Yes, but it might be a good idea, to fix this in the test.sh.

dermesser commented 9 years ago

Sorry, I misunderstood your problem. Do you want to create a pull request? And you're probably right in that it's a Ubuntu problem because I don't experience this on Debian.

eudoxos commented 4 years ago

Sorry, I misunderstood your problem. Do you want to create a pull request? And you're probably right in that it's a Ubuntu problem because I don't experience this on Debian.

Just stumbling accross this, it depends on the default linker. The ld.gold (ELF-only) linker resolves the symbols regardless, the traditional ld.bfd does not.