2017-05-05 75 views
0

我试图交叉编译QT为Debian下拉伸树莓PI 3,但是当我用make -j4编译QT,它提供了以下错误:未定义的参考`dlsym进行”

$ 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目录中的符号链接。

当我运行sudo file * | grep broken时,即使运行脚本来修复符号链接(如sudo),也会报告2个符号链接被破坏。

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的执行:

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

,似乎被打破下面列出的符号链接

./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。

+0

你克隆了什么版本的Qt? – eyllanesc

+0

我克隆了QT的GIT仓库,所以我认为它应该是5.8。我也试过5.7.1,并没有工作。 – Charlie

+0

我遵循以下[教程](https://wiki.qt.io/RaspberryPi2EGLFS),我没有任何问题。 – eyllanesc

回答

1

我遇到了同样的问题,像你一样进行,但使用gcc-5.4.1-linaro-gnueabihf工具链。不幸的是我没有找到问题的根源,但解决方法调用配置像

LIBS=-ldl ./configure ... 
0

与raspbian拉伸EGL库具有不同的名称

/opt/vc/lib/libEGL.so - >的/ opt/VC/lib目录/ libbrcmEGL.so

/opt/vc/lib/libGLESv2.so - > /opt/vc/lib/libbrcmGLESv2.so

所以,我eddited在Qt的源文件:

./qtbase/mkspecs /devices/linux-rasp-pi3-g++/qmake.conf 和改变

-lEGL -lGLESv2

-lbrcmEGL -lbrcmGLESv2

1

符号链接被打破时安装到主机,

$ cd /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/ 
$ sudo rm libdl.so 
$ sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 libdl.so 
+0

请添加更多上下文来解释您提供的三个命令作为解决方案。有关指导,请参阅:https://stackoverflow.com/help/how-to-answer – Daniel