F1F88 / sm-ext-log4sp

Logging for SourcePawn
https://forums.alliedmods.net/showthread.php?t=348776
GNU Affero General Public License v3.0
6 stars 0 forks source link

[BUG] Loading failed on Linux #6

Closed F1F88 closed 2 weeks ago

F1F88 commented 3 weeks ago

Error message

"bin/libstdc++.so.6: version 'GLIBCXX_3.4.20' not found"

Cause

See the Metamod:Source document

Affected range

Solution

Before, this problem was left to the user to fix, but I think it should be as ready as possible to use it out of the box, so that users can be more worry-free.

Manual processing solution (keep records)

# Check whether the server has the required GLIBCXX version
strings ./serverfiles/bin/libstdc++.so | grep GLIBCXX
# Check whether the operating system has the required GLIBCXX version
strings /usr/lib/libstdc++.so.6 | grep GLIBCXX
# If the operating system has the required version, you can directly delete the server's "./serverfiles/bin/libstdc++.so.6" file to use the operating system version
mv ./server/bin/libstdc++.so ./server/bin/libstdc++.so.bk
# If the operating system does not have the required version, you need to refer to other solutions
# Reference link: https://stackoverflow.com/questions/44773296/libstdc-so-6-version-glibcxx%203-4-20-not-found
sudo apt-get update
sudo apt-get install gcc-4.9

# If the problem is solved, the following step is not required
# sudo apt-get upgrade libstdc++6

Compile this project yourself


错误信息

"bin/libstdc++.so.6: version 'GLIBCXX_3.4.20' not found"

产生原因

详情见 Metamod:Source 文档

受影响的范围

解决方案

在之前,这个问题留给了用户自己解决,但我认为应该尽量做到开箱即用,让用户更省心。

手动处理方案(保留记录)

F1F88 commented 3 weeks ago

Already tried solutions

Sometime, although the compiled so file has increased a lot, it has not solved this problem.

$ ldd log4sp.ext.so 
ldd: warning: you do not have execution permission for `./log4sp.ext.so'
        linux-gate.so.1 (0xf7f5c000)
        libstdc++.so.6 => /lib/libstdc++.so.6 (0xf7c00000)
        libc.so.6 => /lib/libc.so.6 (0xf7a0a000)
        /lib/ld-linux.so.2 (0xf7f5e000)
        libm.so.6 => /lib/libm.so.6 (0xf793f000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf7e9a000)

$ strings log4sp.ext.so | grep GLIBCXX_3.4.2
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
_ZTINSt6thread6_StateE@@GLIBCXX_3.4.22
_ZNSt6thread6_StateD2Ev@@GLIBCXX_3.4.22
_ZNSt3_V216generic_categoryEv@@GLIBCXX_3.4.21
_ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE@@GLIBCXX_3.4.22
_ZNSt28__atomic_futex_unsigned_base19_M_futex_notify_allEPj@@GLIBCXX_3.4.21
_ZSt24__throw_out_of_range_fmtPKcz@@GLIBCXX_3.4.20
_ZNSt28__atomic_futex_unsigned_base19_M_futex_wait_untilEPjjbNSt6chrono8durationIxSt5ratioILx1ELx1EEEENS2_IxS3_ILx1ELx1000000000EEEE@@GLIBCXX_3.4.21
_ZNSt13runtime_errorC2EPKc@@GLIBCXX_3.4.21
F1F88 commented 1 week ago

这篇博客谈论到了 '-lstdc++' 参数会导致 '-static-libgcc' 和 'static-libstdc++' 失效。 但是没有解释原因 https://blog.csdn.net/10km/article/details/73130579