undefined reference to symbol 'dlclose@@GLIBC_2.2.5'(Qt 调用静态库从mac换到ubuntu 16.04.10报错)

说明

在pro文件里面使用:LIBS +=-L$$PWD/Qssh/lib -lQSsh
这样写的时候在mac上可以正常运行,但是在ubuntu上运行就会报错(libQSsh.a请自行换成linux版本的)

Issies在这里插入图片描述

编译器输出

/usr/bin/ld: /home/archermind/Desktop/baidu/cute_view/Qssh/lib/libQSsh.a(botan.o): undefined reference to symbol ‘dlclose@@GLIBC_2.2.5’
Makefile:687: recipe for target ‘cute_view’ failed
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

解决思路

有人说加个-ldl即可.这个某些情况下是对的.
还有一种情况,就是链接库有问题.比如本案例中,需要链接-lQSsh,结果没有libQSsh.so,却有libQSsh.a,于是什么都链接不上.

解决方法

综合网络上多种方法,单独使用均失败了。将多种方法结合起来使用:
在配置文件pro中,将linux与mac区分开,mac依旧使用旧的

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值