我正在尝试在 Qt 5 上构建氮气6x板由 *i.MX6Q` 供电。
我已经安装了Debian/喘息在板上,我正在使用乌班图12.10交叉编译机。
配置 Qt 就像一个魅力,但我陷入了 make 步骤。
这是我运行的配置脚本:
./configure -v -opensource -confirm-license -reduce-relocations -no-pch -no-xcb -no-opengl -opengl es2 -qt-libpng -qt-zlib -qt-xkbcommon -qt-xcb -qt-pcre -qt-libjpeg -qt-sql-mysql -optimized-qmake\
-make libs -device imx6 \
-compile-examples \
-device-option CROSS_COMPILE=/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabi- \
-sysroot /media/finn/d72e3b65-b529-4e5c-9d30-872e1b0c9973 \
-prefix /opt/qt5
这是我在 make 过程中大约 5 分钟收到的错误:
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld:
/media/finn/d72e3b65-b529-4e5c-9d30-872e1b0c9973/usr/lib/libm.a(mpa.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/media/finn/d72e3b65-b529-4e5c-9d30-872e1b0c9973/usr/lib/libm.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
我之前遇到过同样的错误,当它尝试访问 libz.a 时,但将 qt-zlib 参数添加到配置命令中修复了该问题。
许多文章指出应该重新编译受影响的应用程序/库,但我认为这是不可能的,因为 libm 是 libc6 的一部分。
我已经尝试使用重新安装它aptitude remove libc6-dev zlib1g-dev g++-4.6
and apt-get install gcc g++ make flex bison openssl libssl-dev perl perl-base perl-modules libperl-dev build-essential
遗憾的是这并没有解决问题。
Debian 已使用官方网络安装程序以及主板制造商 Boundarydevices 提供的内核和覆盖层进行安装。
有谁知道如何解决这个问题?
我的下一步是安装一个全新的 Debian 系统,但我真的想避免这种情况。
Edit
使用 -static 选项编译 qtbase 对我有用,但是在 make 步骤期间尝试构建 qtdeclarative 时遇到此错误:
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
/home/finn/qt/qtbase/lib/libQt5Core.a(qlibrary_unix.o): In function `QLibraryPrivate::load_sys()':
qlibrary_unix.cpp:(.text+0xaac): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lqxcb
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libpthread.so.0
/home/finn/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a
collect2: error: ld returned 1 exit status
编辑 2 - 解决方案
我解决了这个问题并成功编译了Qt。
我所需要做的就是重新安装 Ubuntu。这当然不是一个优雅的解决方案,但它对我有用。