最近使用.net 8编写了一段代码,在centos下运行,一不小心,报错了:
[root@p01 EGAPI]# ./ClientAPI
./ClientAPI: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./ClientAPI)
./ClientAPI: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./ClientAPI)
看样子是Linux系统GLIBC的依赖出了问题,查了半天,查到net的仓库有说明:
core/linux.md at main · dotnet/core
上面是.net的集合,以下这个针对.net8的
core/release-notes/8.0/supported-os.md at main · dotnet/core
Linux compatibility
Microsoft-provided portable Linux builds define minimum compatibility primarily via libc version.
Libc Version Architectures Source glibc 2.23 Arm32, Arm64, x64 Ubuntu 16.04 musl 1.2.2 Arm32, Arm64, x64 Alpine 3.13
原来系统需要glibc版本是2.23,我查了下我的系统,才2.17,只好降级了:
ldd --version
ldd (GNU libc) 2.17
再查一下.net 6的吧,core/release-notes/6.0/supported-os.md at main · dotnet/core
Linux compatibility
Microsoft-provided portable Linux builds define minimum compatibility primarily via libc version.
Libc Version Architectures Source glibc 2.17 x64 CentOS 7 glibc 2.23 Arm64, Arm32 Ubuntu 16.04 musl 1.2.2 Arm64, x64 Alpine 3.13 Note: Microsoft-provided portable Arm32 glibc builds are supported on distro versions with a Y2038 incompatible glibc or a Y2038 compatible glibc with _TIME_BITS set to 32-bit, for example Debian 12, Ubuntu 22.04, and lower versions.
正好支持,就用他了



30

被折叠的 条评论
为什么被折叠?



