2017-05-05 211 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