g++ ADS_APIServer.o ../../udt/src/libudt.so ../Commlib/libCommlib.so libADS_APIServer.so -o ADS_APIServer
ADS_APIServer.o: In function soapOpenThread(void*)':
pthread_create'
ADS_APIServer.cpp:(.text+0x8b0): undefined reference to
ADS_APIServer.o: In function main':
pthread_create'
ADS_APIServer.cpp:(.text+0xd85): undefined reference to
ADS_APIServer.cpp:(.text+0xdb1): undefined reference to pthread_create'
pthread_create'
ADS_APIServer.cpp:(.text+0xddd): undefined reference to
ADS_APIServer.cpp:(.text+0xe09): undefined reference to pthread_create'
pthread_create' follow
ADS_APIServer.o:ADS_APIServer.cpp:(.text+0xe38): more undefined references to
../../udt/src/libudt.so: undefined reference to pthread_mutex_trylock'
pthread_mutexattr_settype'
../Commlib/libCommlib.so: undefined reference to
../../udt/src/libudt.so: undefined reference to pthread_key_create'
dlsym'
../Commlib/libCommlib.so: undefined reference to
../Commlib/libCommlib.so: undefined reference to dlerror'
pthread_getspecific'
../../udt/src/libudt.so: undefined reference to
../Commlib/libCommlib.so: undefined reference to pthread_mutexattr_destroy'
pthread_mutexattr_init'
../Commlib/libCommlib.so: undefined reference to
../../udt/src/libudt.so: undefined reference to pthread_key_delete'
dlopen'
../Commlib/libCommlib.so: undefined reference to
../../udt/src/libudt.so: undefined reference to pthread_setspecific'
dlclose'
../Commlib/libCommlib.so: undefined reference to
../../udt/src/libudt.so: undefined reference to `pthread_join'
linux 链接动态库时产生如下错误
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- yi顽童 2014-03-19 08:03关注
自己顶下,随便结束问答,问题已解决,问题产生的原因是:
pthread这个库不是系统库,在链接时需要在命令行指定 -lpthread 项
dl* 则需要在命令行指定 -ldl 项另外在linux下执行程序时,如果需要链接动态库,下面两个命令有用
1 echo LD_LIBRARY_PATH # 该命令查看当前的配置路径
2 export LD_LIBRARY_PATH=.:../*:/home/.. # 添加路径,其中每个路径以“:”分隔解决 无用评论 打赏 举报
悬赏问题
- ¥15 基于卷积神经网络的声纹识别
- ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
- ¥100 为什么这个恒流源电路不能恒流?
- ¥15 有偿求跨组件数据流路径图
- ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
- ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
- ¥15 CSAPPattacklab
- ¥15 一直显示正在等待HID—ISP
- ¥15 Python turtle 画图
- ¥15 stm32开发clion时遇到的编译问题