我怎么知道Qt是否链接到openssl,以及哪个链接? [英] How do I know if Qt links against openssl, and which one?

查看:165
本文介绍了我怎么知道Qt是否链接到openssl,以及哪个链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看着Qt5.11.0的库(:/Qt/5.11.0/5.11.0/gcc_64/lib/),我想知道是哪个链接了openssl.因此,我执行了以下操作:

Looking at the libs (:/Qt/5.11.0/5.11.0/gcc_64/lib/) of Qt5.11.0, I was wondering which one was linking openssl. So I ran the following:

for lib in `ls *.so`; do ldd $lib | grep ssl; done

我没有任何输出,这表明没有库与openssl链接.但是我认为Qt必须以某种方式与之链接(例如,用于联网).

And I got no output, suggesting that none of the libraries are linking against openssl. But I believe that Qt must link against it somehow (e.g. for networking).

链接如何完成?在哪里寻找openssl?我是否有办法知道在系统上找到了哪个Qt(例如,假设我有多个Qt)?

How is the linking done? And where does it look for openssl? Do I have a way to know which one Qt found on my system (e.g. given I have multiple ones)?

推荐答案

Qt在运行时动态链接某些库.为了查看加载了哪些库,可以根据Matteo的提示检查动态链接器的诊断输出:

Qt links some libraries dynamically at runtime. In order to see which libraries are loaded, one can check the diagnostic output of the dynamic linker, as hinted by Matteo:

说我的可执行文件称为QGroundcontrol:

Say my executable is called QGroundcontrol:

在Linux上:

LD_DEBUG=libs ./QGroundcontrol 2>&1 | grep -E "ssl|crypto"

在macOS上:

DYLD_PRINT_LIBRARIES=1 ./QGroundcontrol 2>&1 | grep -E "ssl|crypto"

由此我可以看到Qt在系统上找到了openssl.

From this I could see that Qt finds openssl on the system.

现在,我仍然不知道如何告诉Qt看看其他地方(以防我想链接另一个openssl),但是

Now, I still don't know how I can tell Qt to look somewhere else (in case I want to link another openssl), but that's another question.

这篇关于我怎么知道Qt是否链接到openssl,以及哪个链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆