./cod_lnxded: error while loading shared libraries: libstdc++.so.5:
cannot open shared object file: No such file or directory
Cause
Every classic Call of Duty dedicated server binary is i386, and the older ones link against
libstdc++.so.5, which was superseded in 2005. A 64-bit Debian or Ubuntu has neither the
32-bit loader nor that library by default.
Variants of the same problem:
./cod2_lnxded: No such file or directory # the 32-bit loader itself is missing
error while loading shared libraries: libgcc_s.so.1
The "No such file or directory" one is particularly confusing because the file is clearly
there. The message refers to the interpreter (/lib/ld-linux.so.2), not to the binary.
Fix
Enable the i386 architecture and install the runtime:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y libc6:i386 libgcc-s1:i386 lib32stdc++6 libstdc++5:i386
On CoD4X, also:
sudo apt install -y zlib1g:i386 libcurl4:i386
Confirm what is still missing:
file ./cod2_lnxded # should say ELF 32-bit LSB
ldd ./cod2_lnxded | grep 'not found'
If libstdc++5:i386 is not in your repositories
Recent releases dropped it. Two options:
- Run the server in a container with an older base image. This is the cleaner answer and the whole setup is in running CoD servers in Docker.
- Fetch the package from an older release's archive and install it manually. It has no dependencies beyond libc, so this works, but you own the result.
