说明
在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依旧使用旧的