最近在编写一个程序时(x64 Linux,Arm下没有这个问题),出现了undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'”,明明有设置-pthread(l60870里用到了这个库)。经过测试,有两种解决办法
1、任意一个代码里调用
pthread_create
2、将lpthread放到最后
-lssl -lcrypto -lmosquitto -lpthread -lcares -lzlog -l60870 -lcjson
Linux c++ 试验-10 一例undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'”
最新推荐文章于 2024-08-15 20:29:14 发布