gpt4 book ai didi

qt - 在 Ubuntu 16.04.1 上使用 OpenSSL 构建 Qt 失败

转载 作者:太空宇宙 更新时间:2023-11-03 12:44:51 26 4
gpt4 key购买 nike

我几乎花了一周时间尝试在 Ubuntu 16.04.1 x64 上使用 OpenSSL 构建 Qt5.8.0。

首先,我下载了 OpenSSL v1.0.2k 的源代码。然后我用命令配置它

./Configure --prefix=$PWD/dist -shared linux-x86_64

然后我一个一个地运行这些命令:

make depend
make
make install

所以我在/home/user/openssl-OpenSSL_1.0.2k/dist 中安装了 Openssl

然后我从官网下载了Qt,用源码安装,所以源码在/home/user/Qt5.8.0/5.8/Src然后我尝试用命令配置它

OPENSSL_LIBS='-L/home/user/openssl-OpenSSL_1_0_2k/dist/lib -lssl -lcrypto' ./configure -prefix /home/user/qt5_static -opensource -confirm-license -release -nomake examples -nomake tests -static -openssl-linked -I /home/user/openssl-OpenSSL_1_0_2k/dist/include/openssl -L /home/user/openssl-OpenSSL_1_0_2k/dist/lib

但是出现了这些错误:

ERROR: Feature 'openssl' was enabled, but the pre-condition '!features.securetransport && tests.openssl' failed.

ERROR: Feature 'openssl-linked' was enabled, but the pre-condition'features.openssl && libs.openssl' failed.

我哪里做错了,如何解决这个问题?

提前谢谢你,抱歉我的英语不好。

最佳答案

我在尝试静态链接 openSSL 时遇到了同样的问题,并找到了以下解决方案:

1) 安装openSSL

sudo apt-get update && sudo apt-get install libssl-dev

2) 从源配置和构建 qt,包括 -openssl-linked 选项,我的示例配置:

/home/someuser/Qt/5.8/Src/configure -c++std c++11 -static -release -platform linux-g++-64 -prefix /home/someuser/Qt/StaticRelease58 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -qt-xcb -make libs -openssl-linked -nomake tools -nomake examples -nomake tests -opensource -confirm-license -skip qtwayland -skip qtwebview -skip qtwebengine -skip qtwebchannel -no-qml-debug

请注意,要静态构建 QT,您还必须安装此处描述的其他包:

http://doc.qt.io/qt-5/linux-requirements.html

http://doc.qt.io/qt-5/linux-deployment.html

附言使用默认设置,从 QT5.8 动态链接到 openSSL 对我来说效果很好。

关于qt - 在 Ubuntu 16.04.1 上使用 OpenSSL 构建 Qt 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41988625/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com