Bootstrap

(二)afsim第三方库编译(qt编译)

注意:源码编译的路径不能有中文否则报错,压缩包必须用官网下载的xz格式解压的才可以,否则sudo ./configure命令找不到

先编译openssl3.1.1软件包,否则编译的qt库将不支持network,相关库的编译(上文(一)afsim第三方库编译-CSDN博客,已经编好所以这里不需要再编,直接在系统变量里设置它的路径qt编译时就可以识别到)

安装依赖项

sudo apt-get update

sudo apt-get install git '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev flex libicu-dev libxslt-dev ruby 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 libegl1-mesa-dev gperf bison nodejs libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev libbz2-dev libcups2-dev libdrm-dev libgcrypt* gyp ninja-build pulseaudio* libthread*

sudo apt install clang libclang-dev

cd在解压后的目录执行

sudo ./configure -xcb -openssl-linked -I$AFSIM_3RDPARTY_PATH/openssl-3.1.1-x64-lnx/include -L$AFSIM_3RDPARTY_PATH/openssl-3.1.1-x64-lnx/lib -no-libjpeg --prefix=$AFSIM_3RDPARTY_PATH/qt-5.12.11-x64-lnx

说明:qt源码中包含jpeg8.0版本源码,这个版本jepg与编译osg时依赖的jpeg62版本不兼容,导致afsim启动时有个异常,所以通过-no-libjpeg来取消编译qjpeg.so。选项来自:

会提示选项(o表示开源版)

第一个选 o

第二个选 y

编译安装qt

sudo make -j8 && sudo make install

添加环境变量:

sudo vim ~/.bashrc

按 i 进入编辑

export PATH=$AFSIM_3RDPARTY_PATH/qt-5.12.11-x64-lnx/bin:"$PATH"

按 ESC 退出编辑

:wq 保存退出

;