使用.net在linux下,glibc依赖问题

最近使用.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.

LibcVersionArchitecturesSource
glibc2.23Arm32, Arm64, x64Ubuntu 16.04
musl1.2.2Arm32, Arm64, x64Alpine 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.

LibcVersionArchitecturesSource
glibc2.17x64CentOS 7
glibc2.23Arm64, Arm32Ubuntu 16.04
musl1.2.2Arm64, x64Alpine 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.

正好支持,就用他了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值