1. 编译链接缺少libpthread.so库
报错:
undefined reference to symbol 'pthread_sigmask@@GLIBC_2.2.5'
解决:
添加-lpthread链接项。
2.编译链接缺少liblibm.so库
报错:
undefined reference to symbol 'ceil@@GLIBC_2.2.5'
解决:
添加-lm链接项。

ChatGPT
The errors you're seeing are linker errors, indicating that the linker cannot find the definitions for the pthread_sigmask and ceil functions, which are part of the POSIX threads library (libpthread) and the standard math library (libm), respectively. The suffix @@GLIBC_2.2.5 signifies that these symbols are versioned symbols introd

文章讲述了在编译C程序时遇到链接器错误,涉及pthread_sigmask和ceil函数,需添加-lpthread和-lm链接项以链接到libpthread和libm库。解决方法包括理解错误含义和编译命令调整。
订阅专栏 解锁全文

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



