嵌入式中Qt5.7.1添加支持openssl方法

嵌入式中Qt5.7.1添加支持openssl方法_第1张图片

1、openssl编译

  • 版本:openssl-1.0.2g
    一定要选对Qt版本对应的openssl版本,由于开始选的openssl版本不对,导致编译Qt时出现很多错误。

  • 交叉编译

./config no-asm shared --prefix=/opt/Xilinx2018_zynq/zynq_openssl_1.0.2/ --cross-compile-prefix=/opt/Xilinx/SDK/2018.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-

make -j4

make install

2、Qt5.7.1编译

1.
首先确保qt源码目录下交叉编译命令生效
cd qt-everywhere-opensource-src-5.7.1 
source /opt/Xilinx/SDK/2018.3/settings64.sh

2.执行configure,其配置如下:
./configure -xplatform arm-linux-gnueabihf-g++ \
    -openssl-linked \
    -I/opt/Xilinx2018_zynq/zynq_openssl_1.0.2/include \
    -L/opt/Xilinx2018_zynq/zynq_openssl_1.0.2/lib -lssl -lcrypto \
    -opensource \
    -confirm-license \
    -skip qtquickcontrols \
    -skip qtwebchannel \
    -skip qtactiveqt \
    -skip qtandroidextras \
    -skip qtdeclarative \
    -skip qtimageformats \
    -skip qtmacextras \
    `#-skip qtserialport` \
    -skip qtx11extras \
    -skip qtxmlpatterns \
    -skip qtconnectivity \
    -skip qtdoc \
    -skip qtgraphicaleffects \
    -skip qtlocation \
    -skip qtmultimedia \
    -skip qtsensors \
    -skip qttools \
    -skip qttranslations \
    -skip qtwayland \
    -skip qtwebchannel \
    -skip qtwebengine \
    `#-skip qtwebsockets` \
    -skip qtwinextras \
    -verbose \
    `#-no-gif` \
    `#-no-libjpeg` \
    -qt-libjpeg \
    -qt-libpng \
    -no-mtdev \
    -no-sql-db2 \
    -no-sql-ibase \
    -no-sql-mysql \
    -no-xcb \
    -qt-freetype \
    -fontconfig \
    -no-harfbuzz \
    -no-xinput2 \
    -no-xcb-xlib \
    -no-pulseaudio \
    -no-alsa \
    -no-cups \
    -no-iconv \
    -no-icu \
    -no-eglfs \
    -no-dbus \
    -prefix $ZYNQ_QT_INSTALL
3. make

3、更新库

将新生成的libQt5NetWork、libQt5WebSocket相关的库文件替换;然后再把openssl相关的库libssl、libcrypto放在目标板下

你可能感兴趣的:(鸿蒙万物互联人工智能之卓越,qt,开发语言)