ubuntu QT openssl支持https

1、Building Qt 5 from Git - Qt Wiki

2、下载编译对应的opengssl [ 1.1.1 ] - /source/old/1.1.1/index.html

3、安装所需基础工具

sudo apt-get install build-essential perl python3 git
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby
sudo apt-get install libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libxtst-dev libxss-dev libdbus-1-dev libevent-dev libfontconfig1-dev libcap-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libegl1-mesa-dev gperf bison nodejs
sudo apt-get install libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev
sudo apt install clang libclang-dev

4、下载源码并编译

git clone https://code.qt.io/qt/qt5.git
cd qt5
git checkout 5.15.2
git submodule update --init --recursive                     # updating each submodule to match the supermodule
mkdir qt5-build
mkdir output
cd qt5-build
OPENSSL_LIBS='-L/home/opensource/openssl-1.1.1g/build/lib -lssl -lcrypto' ../configure -developer-build -opensource -nomake examples -nomake tests  -openssl-linked -I/home/opensource/openssl-1.1.1g/build/include -prefix /home/opensource/qt5/output
make

OpenSSL必须是yes。

5、将编译好的库拷贝到qt对应的目录即可

注意,编译过程中报错的解决方法:

一、QT Ubuntu Gcc 静态编译源码 5.15.2 error numeric_limits 出错

修改 Src/qtbase/src/corelib/global/qglobal.h

ifdef __cplusplus

include

include

include

# include //加上这行

endif

ifndef ASSEMBLER

include

include

endif

二、Static compile error Qt5.12.0: bootstrap-private

Static compile error Qt5.12.0: bootstrap-private | Qt Forum

Your

  1. source directory
  2. build directory (your pwd)
  3. install directory (assigned with -prefix)

must be 3 different directories.

三、/usr/bin/ld: warning: libssl.so.1.1, needed by /home/opensource/qt5/qt5-build/qtbase/lib/libQt5Network.so.5, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libcrypto.so.1.1, needed by /home/opensource/qt5/qt5-build/qtbase/lib/libQt5Network.so.5, not found (try using -rpath or -rpath-link)

export LD_LIBRARY_PATH=/home/opensource/openssl-1.1.1g/build/lib:$LD_LIBRARY_PATH

相关推荐

  1. django支持https

    2024-02-02 07:02:01       35 阅读
  2. springboot设置RestTemplate支持http&https

    2024-02-02 07:02:01       32 阅读
  3. Tomcat同时支持httphttps

    2024-02-02 07:02:01       30 阅读
  4. SpringBoot项目中同时支持httpshttp协议

    2024-02-02 07:02:01       39 阅读
  5. nginx 同一个端口支持httphttps配置

    2024-02-02 07:02:01       44 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-02 07:02:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-02 07:02:01       101 阅读
  3. 在Django里面运行非项目文件

    2024-02-02 07:02:01       82 阅读
  4. Python语言-面向对象

    2024-02-02 07:02:01       91 阅读

热门阅读

  1. 私有化部署dos游戏

    2024-02-02 07:02:01       44 阅读
  2. Node.js REPL详解

    2024-02-02 07:02:01       59 阅读
  3. git 凭据缓存不可用;没有 unix 套接字支持”警告

    2024-02-02 07:02:01       52 阅读
  4. 【lesson33】MySQL使用C/C++连接

    2024-02-02 07:02:01       45 阅读
  5. 第2章 Linux 中执行命令

    2024-02-02 07:02:01       47 阅读
  6. iOS自动打包如何用Python实现

    2024-02-02 07:02:01       49 阅读
  7. Leetcode 《面试经典150题》169. 多数元素

    2024-02-02 07:02:01       50 阅读