赞
踩
64位平台的编译器gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz操作如下:
tar -xvf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz
mv gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/* aarch64-linux-gnu-6.3.1
sudo cp -rf aarch64-linux-gnu-6.3.1/ /opt
vim /etc/bash.bashrc
添加如下行:
PATH=$PATH:/opt/aarch64-linux-gnu-6.3.1/bin
添加完成后source生效一下:
source /etc/bash.bashrc
https://download.qt.io/archive/qt/5.12/5.12.3/
国内下载源:
阿里:https://mirrors.aliyun.com/qt/
清华:https://mirrors.tuna.tsinghua.edu.cn/qt
北京理工大学:http://mirror.bit.edu.cn/qtproject/
中国互联网络信息中心:https://mirrors.cnnic.cn/qt/
sudo chmod u+x qt-opensource-linux-x64-5.12.3.run
./qt-opensource-linux-x64-5.12.3.run
# # qmake configuration for building with aarch64-linux-gnu-g++ # MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib #添加以下 QT_QPA_DEFAULT_PLATFORM = linuxfb QMAKE_CFLAGS_RELEASE += -O2 -march=armv8-a -lts QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv8-a -lts include(../common/linux.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) # modifications to g++.conf # 修改以下 QMAKE_CC = /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-gcc QMAKE_CXX = /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-g++ QMAKE_LINK = /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-g++ QMAKE_LINK_SHLIB = /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-g++ # modifications to linux.conf # 修改以下 QMAKE_AR = /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-ar cqs QMAKE_OBJCOPY = /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-objcopy QMAKE_NM = /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-nm -P QMAKE_STRIP = /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-strip load(qt_config)
sudo mkdir build
cd build
sudo touch build.sh
sudo chmod +x build.sh
../configure \ -prefix /opt/qt-5.12.3-arm64/ \ -opensource -confirm-license \ -release \ -strip \ -shared \ -xplatform linux-aarch64-gnu-g++ \ -optimized-qmake \ -c++std c++11 \ --rpath=no \ -pch \ -skip qt3d \ -skip qtactiveqt \ -skip qtandroidextras \ -skip qtcanvas3d \ -skip qtconnectivity \ -skip qtdatavis3d \ -skip qtdoc \ -skip qtgamepad \ -skip qtlocation \ -skip qtmacextras \ -skip qtnetworkauth \ -skip qtpurchasing \ -skip qtremoteobjects \ -skip qtscript \ -skip qtscxml \ -skip qtsensors \ -skip qtspeech \ -skip qtsvg \ -skip qttools \ -skip qttranslations \ -skip qtwayland \ -skip qtwebengine \ -skip qtwebview \ -skip qtwinextras \ -skip qtx11extras \ -skip qtxmlpatterns \ -make libs \ -make examples \ -nomake tools -nomake tests \ -gui \ -widgets \ -dbus-runtime \ --glib=no \ --iconv=no \ --pcre=qt \ --zlib=qt \ -no-openssl \ --freetype=qt \ --harfbuzz=qt \ -no-opengl \ -linuxfb \ --xcb=no \ --libpng=qt \ --libjpeg=qt \ --sqlite=qt \ -plugin-sql-sqlite \ -recheck-all
./build.sh
make
sudo make install
路径:
路径:/opt/qt-5.12.3-arm64/bin/qmake
路径: /opt/aarch64-linux-gnu-6.3.1/bin/aarch64-linux-gnu-gdb
./ballancedBicycle
如:拷贝在其他的ARM系统上运行时,报错:
error while loading shared libraries: libQt5SerialPort.so.5:cannot open shared object file: no such file or directory
则说明缺少串口通信库,可以在系统终端运行指令:
sudo apt-get install libqt5serialport5
检查库文件的存在:安装完成后,您可以使用locate命令来检查libQt5SerialPort.so.5文件是否真的存在于您的系统中。如果您的系统没有locate,您可以使用find或ls命令。
确保正确的环境变量:有时,库文件的路径可能不在系统的默认库路径中。您可以通过设置LD_LIBRARY_PATH环境变量来指定额外的库路径。例如:
export LD_LIBRARY_PATH=/path/to/library:
这里的**/path/to/library应该替换为包含libQt5SerialPort.so.5**的实际路径
最后source一下bashrc文件,再重新运行拷贝的可执行文件
source ~/.bashrc
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。