qt - 对 `dlsym' 的 undefined reference

我正在尝试在 Debian Stretch 下为树莓派 3 交叉编译 QT,但是当我使用 make -j4 编译 QT 时,出现以下错误:

$ make -j4>log
/home/charlie/Rpi/qt5/qtbase/lib/libQt5EglSupport.a(qeglplatformcontext.o): In function `QEGLPlatformContext::getProcAddress(char const*)':
qeglplatformcontext.cpp:(.text+0xa4): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
make[5]: *** [../../../../plugins/platforms/libqminimalegl.so] Error 1
make[4]: *** [sub-minimalegl-make_first] Error 2
make[4]: *** Waiting for unfinished jobs....
/home/charlie/Rpi/qt5/qtbase/lib/libQt5EglSupport.a(qeglplatformcontext.o): In function `QEGLPlatformContext::getProcAddress(char const*)':
qeglplatformcontext.cpp:(.text+0xa4): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
make[6]: *** [../../../../lib/libQt5EglFSDeviceIntegration.so.5.8.1] Error 1
make[5]: *** [sub-eglfsdeviceintegration-pro-make_first-ordered] Error 2
make[4]: *** [sub-eglfs-make_first] Error 2
make[3]: *** [sub-platforms-make_first] Error 2
make[2]: *** [sub-plugins-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qtbase-make_first] Error 2

我已经阅读了很多包含相同 dlsym 错误的类似帖子,并且我已经尝试了其中给出的解决方案,但到目前为止还没有成功。我已按照 here 中所示进行操作直到现在我仍然怀疑 lib 目录中的符号链接(symbolic link)。

当我运行 sudo file * | grep broken,据报告有 2 个符号链接(symbolic link)被破坏,即使在运行了本应修复符号链接(symbolic link)的脚本(如 sudo)之后也是如此。

./fixQualifiedLibraryPaths /mnt/raspberry-rootfs/ ~/Rpi/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc

下面列出了似乎损坏的符号链接(symbolic link):

libblas.so.3gf:                     broken symbolic link to /etc/alternatives/libblas.so.3gf
liblapack.so.3gf:                   broken symbolic link to /etc/alternatives/liblapack.so.3gf

./configure 执行如下:

./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/Rpi/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/raspberry-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi

你们能指出我在做什么吗?

PD:我还安装了 libncurses5 和 lib32z1,并通过 git 克隆获得了 qt。

最佳答案

我遇到了同样的问题,按照您的方式进行,但使用的是 gcc-5.4.1-linaro-gnueabihf 工具链。不幸的是,我没有找到根本原因,但解决方法是像这样调用配置

LIBS=-ldl ./configure ...

关于qt - 对 `dlsym' 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43815010/

相关文章:

php - Laravel contains() 用于多个值

django - 值错误 : Cannot use Queryset for "": Use a Q

node.js - config.js 文件的 Typescript 版本

r - 观星者,无输出

php - WooCommerce 以编程方式获取购物车 ID

python - 如何使用 Python Selenium 获取多个元素的文本内容?

ruby-on-rails - 使用 Chartkick 和 Rails 的多系列折线图

json - JSON 模式中的变量对象名称

angular - 如何正确检查用户是否在 Angular4 中经过身份验证?

visual-studio-code - VS code终端光标效果