qt - 为树莓派构建 Qt 库时出错

标签 qt compiler-errors makefile cross-compiling qt5

我正在尝试为我的 RPI 编译 Qt 5 库,但它总是崩溃。

这些是我试图遵循的指南:

http://qt-project.org/wiki/RaspberryPi_Beginners_guide
http://qt-project.org/wiki/RaspberryPi

我已经根据指南下载了交叉编译器和 sysroot-image,并从 git repo 中提取了 Qt5 源代码。

在遵循其中一个指南之后,我现在被困在 make .

这是我收到的错误:

.obj/release-shared/qlibrary_unix.o: In function `QLibraryPrivate::load_sys()':
qlibrary_unix.cpp:(.text+0xf84): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/esa/qtonpi/rpi_image/usr/lib/arm-linux-gnueabihf/libdl.a(dlopen.o): In function `dlopen':
(.text+0xc): undefined reference to `__dlopen'
/home/esa/qtonpi/rpi_image/usr/lib/arm-linux-gnueabihf/libdl.a(dlclose.o): In function `dlclose':
(.text+0x0): undefined reference to `__dlclose'
/home/esa/qtonpi/rpi_image/usr/lib/arm-linux-gnueabihf/libdl.a(dlsym.o): In function `dlsym':
(.text+0xc): undefined reference to `__dlsym'
/home/esa/qtonpi/rpi_image/usr/lib/arm-linux-gnueabihf/libdl.a(dlerror.o): In function `dlerror':
(.text+0x0): undefined reference to `__dlerror'
/home/esa/qtonpi/rpi_image/usr/lib/arm-linux-gnueabihf/libm.a(feholdexcpt.o): In function `feholdexcept':
(.text+0x48): undefined reference to `_dl_hwcap'
/home/esa/qtonpi/rpi_image/usr/lib/arm-linux-gnueabihf/libm.a(fesetenv.o): In function `fesetenv':
(.text+0x64): undefined reference to `_dl_hwcap'
collect2: virhe: ld:n paluuarvo oli 1                                           # collect2: error: ld returnvalue was 1
make[2]: *** [../../lib/libQt5Core.so.5.0.0] Virhe 1                            # Error 1
make[2]: Poistutaan hakemistosta "/home/esa/qtonpi/qt5/qtbase/src/corelib"      # Leaving directory
make[1]: *** [sub-corelib-make_first] Virhe 2                                   # Error 2
make[1]: Poistutaan hakemistosta "/home/esa/qtonpi/qt5/qtbase/src"              # Leaving directory
make: *** [sub-src-make_first] Virhe 2                                          # Error 2

最佳答案

修复 sysroot 中库的路径。一些库是指向绝对路径的符号链接(symbolic link),这些符号链接(symbolic link)在放置在系统中时会被破坏。检查类似/home/esa/qtonpi/rpi_image/usr/lib/arm-linux-gnueabihf/libdl.so 或类似的东西。您应该看到那些指向绝对路径的已损坏符号链接(symbolic link)。修复所有这些。在您报告的文件中,为此目的提供了一个脚本。你运行它了吗(https://gitorious.org/cross-compile-tools/cross-compile-tools/blobs/master/fixQualifiedLibraryPaths)?

也尝试检查this如果您仍然遇到麻烦:我写了一些笔记,从 git 编译最新版本的 wheezy 图像。

关于qt - 为树莓派构建 Qt 库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13626726/

相关文章:

c++ - 重置 QValidator 是否会泄漏内存?

python - python程序显示编译错误

c++ - 在 Qt 中创建模型时出现多个错误

具有多个文件的 latex aspell 的 makefile

c - 使错误别名为 undefined symbol devone_init

c++ - QT 应该在 int 增量上阻塞吗?

python - 从另一个文件 PyQT 打开一个 GUI 文件

c++ - 使用 Qt Creator 交叉编译 Qt 应用程序的简便方法?

linux - Python 构建完成,但未找到构建这些模块的必要位

c++ - 正确编写我的 C++ Makefile 的问题