centos上使用makefile编译sliver时 提示gcc 错误,cannot find -ldl cannot find -lpthread cannot find -lc

发布时间 2023-05-17 09:16:55作者: 干炸小黄鱼

github.com/bishopfox/sliver/server

/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status

这个错误通常是因为缺少相关的库文件,具体来说,缺少了 libdl、libpthread 和 libc 库文件。您可以尝试安装这些库文件,具体安装方式取决于您使用的操作系统和包管理器。

yum install gcc gcc-c++ -y
yum install glibc-static libstdc++-static –y

再执行就ok