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 安卓adb backup备份应用数据失败
- ¥15 eclipse运行项目时遇到的问题
- ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
- ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
- ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
- ¥50 成都蓉城足球俱乐部小程序抢票
- ¥15 yolov7训练自己的数据集
- ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
- ¥15 电力市场出清matlab yalmip kkt 双层优化问题
- ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)