libsocket icon indicating copy to clipboard operation
libsocket copied to clipboard

Error while Linking on Ubuntu 14.04

Open benjamin-lieser opened this issue 11 years ago • 5 comments

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 avatar Dec 25 '14 14:12 benjamin-lieser

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)

benjamin-lieser avatar Dec 25 '14 22:12 benjamin-lieser

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

dermesser avatar Dec 26 '14 09:12 dermesser

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

benjamin-lieser avatar Dec 26 '14 09:12 benjamin-lieser

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.

dermesser avatar Dec 26 '14 16:12 dermesser

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.

eudoxos avatar Oct 30 '20 08:10 eudoxos