-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用cmake依赖brpc编译成功,运行报undefined symbol: pthread_mutex_lock #1086
Comments
遇到了同样的问题 |
+1 |
@bai-charisu have you solve this problem? |
解决了,怀疑是加载顺序的问题,在编译的时候把-lbrpc放在最前面之后ok了 |
ok,thanks very much. |
感觉本质是因为brpc通过 https://zhuanlan.zhihu.com/p/44132805 我的项目中不方便修改pthread的链接位置,可以利用 export LD_PRELOAD=/lib/libbrpc.so |
使用cmake动态依赖brpc,编译显示正常,但是运行的时候报错:
![image](https://user-images.githubusercontent.com/29573385/79290344-718bc600-7efe-11ea-9948-909a47874238.png)
nm查看libbrpc.so是有这个符号的
![image](https://user-images.githubusercontent.com/29573385/79290386-8ff1c180-7efe-11ea-9365-75ac04a5ad17.png)
ldd查看,可执行程序也确实链接了brpc和pthread,所以不知道问题出在哪里:
![image](https://user-images.githubusercontent.com/29573385/79290466-c2032380-7efe-11ea-87e6-28ff24e5f0c2.png)
The text was updated successfully, but these errors were encountered: