【发布时间】:2017-07-01 13:20:29
【问题描述】:
我正在尝试为 Beagle Bone Black 编写一个简单的控制台 Qt/C++ 应用程序。 Debian 8 映像安装了 Qt 5.3.2。 SDK中安装的Qt给了我交叉编译错误,所以我自己交叉编译了Qt 5.6.2 from source。由于硬浮动问题,这需要 5.6+ 版本,然后进行一些错误修复和黑客攻击才能开始工作。
当我编译应用程序并在 BBB 上运行它时,它会说:
./BeagleBoneTestCrossCompile
./BeagleBoneTestCrossCompile: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: no version information available (required by ./BeagleBoneTestCrossCompile)
./BeagleBoneTestCrossCompile: relocation error: ./BeagleBoneTestCrossCompile: symbol _ZN6QDebugD1Ev, version Qt_5 not defined in file libQt5Core.so.5 with link time reference
这些版本符号让我很困惑。使用 objdump -TC 我可以看到我编译的 Qt 5.6 有它们(一个示例行):
000d910d g DF .text 00000088 Qt_5 QChar::hasMirrored(unsigned int)
但是,Debian BBB 映像中安装的版本没有:
000c8bb0 g DF .text 00000074 Base QChar::hasMirrored(unsigned int)
X86_64 Ubuntu 16.04 服务器上也没有安装该版本:
0000000000132a30 g DF .text 0000000000000064 Base QChar::hasMirrored(unsigned int)
但是,使用在线安装程序安装在我的主目录中的版本(仅适用于 x86_64)确实具有 Qt_5 版本:
0000000000130ec0 g DF .text 000000000000005e Qt_5 QChar::hasMirrored(unsigned int)
然后我尝试将我的交叉编译的 Qt 5.6 包含在我的应用程序中,但随后它上升了:
> LD_LIBRARY_PATH=libs ./BeagleBoneTestCrossCompile
./BeagleBoneTestCrossCompile: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by libs/libQt5Core.so.5)
过去,我使用本地 Qt 编译 x86 软件,带有 Qt_5 版本标签,并在没有版本标签的 Ubuntu 16.04 服务器上运行它,它加载了 *.so 文件就好了。那么,为什么这突然成为一个问题,以及如何使用随附的 Qt 库运行 Qt 应用程序?
【问题讨论】:
标签: c++ linux qt cross-compiling beagleboneblack