compiling for linux Created 5 years ago2018-04-06 10:55:41 UTC by tschumann tschumann

Created 5 years ago2018-04-06 10:55:41 UTC by tschumann tschumann

Posted 5 years ago2018-04-06 10:55:41 UTC Post #339223
Anyone got experience with compiling and distributing a Half-Life mod/plugin for Linux and having it work for most distros etc?
I'm working on https://github.com/tschumann/sandbot and a user has reported that on their distro they get the following error: "LoadLibrary failed on home/name/dod2017/dod./dod/dlls/sandbot.so: ./libstdc++.so.6: version `CXXABI_1.3.9' not found"
I've done some digging and it seems like an incompatibility between libstdc++ versions but I have libstdc++.so.6.0.22 and they have libstdc++.so.6.0.24 and https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html says "Binaries with equivalent DT_SONAMEs are forward-compatibile", so I'm not exactly sure what's going on.
Posted 5 years ago2018-04-06 13:45:04 UTC Post #339224
The libstdc++.so.6 which is shiped with steam is the problem.

execute strings libstdc++.so.6 | grep CXX against the steam version and also which is the one of your repo. Then you'll see the problem. It's known and for a quick and dirty fix:

https://steamcommunity.com/app/221410/discussions/0/350542683198244989/

Maybe this helps.
Posted 5 years ago2018-04-07 02:25:06 UTC Post #339229
Ah right. I think one of the people having the problem is using HLDS, and sure enough it does ship with its own libstdc++.so.6 whose latest CXXABI is CXXABI_1.3.7
So I guess steamcmd overrides LD_LIBRARY_PATH with its own linux32/ which means the apt-get installed versions don't get loaded?

Incidentally the Steam libstdc++.so.6 is okay.
Posted 5 years ago2018-04-08 16:58:19 UTC Post #339253
I had the same situation when porting the dedicated server of Zombie Panic! Source 3.0 (Source 2013) to Linux.

I don't remember if it's gonna 100% identical with HLDS/SteamCMD so I will explain what I did with ZPS 3.0 which is on Source 2013. Basically, you open the shell script that act as launcher with a text editor ("srcds_run"). There should be a line that look like this:

export LD_LIBRARY_PATH=bin:$LD_LIBRARY_PATH

Depending on the Linux distribution that you and you user choose (because not all Linux distributions agrees on the standards), you will have to add to the beginning the path to your system's "libstdc++.so.6". On Debian/Ubuntu IIRC, the path should be "/usr/lib/i386-linux-gnu", so the variable would look something like this:

export LD_LIBRARY_PATH=/usr/lib/i386-linux-gnu:bin:$LD_LIBRARY_PATH

Save the file, and it should pickup the "libstdc++.so.6" from your system.

Alternative: You could delete the "libstdc++.so.6" shipped with HLDS/SteamCMD. If it complains about missing file, you could make a symbolic link.
Posted 5 years ago2018-04-13 21:21:14 UTC Post #339312
Thanks - looked like deleting it worked for the person reporting the issue. Probably time to read up on Linux's .so resolution rules (I naively assumed that it would only look at the path that ldd outputs but it looks closer to Windows' .dll resolution).
You must be logged in to post a response.