我有一个用Qt5.12.2编写的应用程序,它使用QCharts绘制一些信号。我希望该应用程序在基于Zynq的板上运行,特别是在Xilinx的Zybo板上。但是,为Xilinx提供的信息仅涵盖Qt版本5.4:https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842110/Qt+Qwt+Build+Instructions+Qt+5.4.2+Qwt+6.1.2,尽管正确编译仍不能提供我需要的Qt Charts模块。
我尝试使用与Xilinx链接中所示的选项相同的选项进行编译,但是无法编译多个模块。为避免此错误,我尝试跳过无法编译的模块,直到到达Qt图表也无法编译的地方。
Qt编译的最后一个配置是:
./configure -xplatform arm-linux-gnueabihf-g++ \
-opensource \
-confirm-license \
-nomake examples \
-verbose -skip qtpurchasing -skip qtconnectivity -skip qtdeclarative -skip qtlocation -skip qtmultimedia -skip qtquickcontrols -skip qtsensors -skip qttools -skip qtwebsockets -skip qtwinextras -skip qtwebchannel -skip qtwebengine \
-no-gif \
-no-libjpeg \
-no-mtdev \
-no-sql-db2 \
-no-sql-ibase \
-no-sql-mysql \
-no-xcb \
-qt-freetype \
-no-fontconfig \
-no-harfbuzz \
-no-xcb-xlib \
-no-cups \
-no-iconv \
-no-icu \
-no-eglfs -no-opengl\
-no-openssl \
-prefix $ZYNQ_QT_INSTALL
在这种情况下,$ZYNQ_QT_INSTALL
被设置为/usr/local/Qt-5.12.2/
。
编译中的最后一个错误是:
arm-linux-gnueabihf-g++ -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../../lib -shared -o libqtchartsqml2.so .obj/chartsqml2_plugin.o .obj/declarativechart.o .obj/declarativexypoint.o .obj/declarativexyseries.o .obj/declarativelineseries.o .obj/declarativesplineseries.o .obj/declarativeareaseries.o .obj/declarativescatterseries.o .obj/declarativepieseries.o .obj/declarativebarseries.o .obj/declarativecategoryaxis.o .obj/declarativemargins.o .obj/declarativeaxes.o .obj/declarativepolarchart.o .obj/declarativeboxplotseries.o .obj/declarativechartnode.o .obj/declarativecandlestickseries.o -L/home/luighi/Qt-crosscompiled/qt5/qtdeclarative/lib -lQt5Quick -L/home/luighi/Qt-crosscompiled/qt5/qtbase/lib -L/home/luighi/Qt-crosscompiled/qt5/qtcharts/lib -lQt5Charts -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lpthread
/opt/Xilinx/SDK/2018.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/7.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lQt5Quick
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:140: ../../qml/QtCharts/libqtchartsqml2.so] Error 1
make[3]: Leaving directory '/home/luighi/Qt-crosscompiled/qt5/qtcharts/src/chartsqml2'
make[2]: *** [Makefile:91: sub-chartsqml2-make_first-ordered] Error 2
make[2]: Leaving directory '/home/luighi/Qt-crosscompiled/qt5/qtcharts/src'
make[1]: *** [Makefile:49: sub-src-make_first] Error 2
make[1]: Leaving directory '/home/luighi/Qt-crosscompiled/qt5/qtcharts'
make: *** [Makefile:493: module-qtcharts-make_first] Error 2
我不知道如何正确交叉编译此版本。您能帮我解决这个问题吗?
答案 0 :(得分:0)
我不建议Xilinx在该文档中描述的方式。以下过程适用于任何运行Linux的目标。
如果您愿意使用Yocto / OpenEmbedded,则可以包含Qt5支持,最新的Xilinx版本v2018.3在其meta-qt5层中支持Qt 5.9.6。在Yocto生成的Linux映像中包含qtcharts之类的包很容易。 meta-toolchain-qt5目标提供了SDK,该SDK可与QtCreator一起使用,以针对目标目标交叉编译应用程序。