查看: 7962|回复: 5

[求助] ubuntu下交叉编译树莓派qt5问题!

[复制链接]
  • TA的每日心情
    开心
    2016-2-1 18:06
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

    发表于 2016-1-28 20:11:26 | 显示全部楼层 |阅读模式
    分享到:
    主机系统是ubuntu
    树莓派用的是2015-11-21-raspbian-jessie
    交叉工具链用的官方github上面的tools(github.com/raspberrypi/tools.git)
    Qt源码用的qt-everywhere-opensource-src-5.5.1
    configure的参数用了
    sudo ./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /mnt/raspberrypi2 -prefix /usr/local/Qt5Embedded
    基本是官方官网提供的那些,因为路径没有设环境变量,所以直接打的地址

    最后在make的过程中出现如下问题
    /home/lyu/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/raspberrypi2/usr/lib/arm-linux-gnueabihf/libz.so: 没有那个文件或目录
    /home/lyu/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/raspberrypi2/usr/lib/arm-linux-gnueabihf/libdl.so: 没有那个文件或目录
    /home/lyu/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/raspberrypi2/usr/lib/arm-linux-gnueabihf/librt.so: 没有那个文件或目录
    /home/lyu/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/raspberrypi2/usr/lib/arm-linux-gnueabihf/libm.so: 没有那个文件或目录
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function qdlerror(): error: undefined reference to 'dlerror'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::unload_sys(): error: undefined reference to 'dlclose'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function qt_linux_find_symbol_sys(char const*): error: undefined reference to 'dlsym'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::resolve_sys(char const*): error: undefined reference to 'dlsym'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::load_sys(): error: undefined reference to 'dlopen'
    .obj/qbytearray.o:qbytearray.cpp:function qUncompress(unsigned char const*, int): error: undefined reference to 'uncompress'
    .obj/qbytearray.o:qbytearray.cpp:function qCompress(unsigned char const*, int, int): error: undefined reference to 'compress2'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt:ateFormat, bool*): error: undefined reference to 'pow'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt:ateFormat, bool*): error: undefined reference to 'floorf'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt:ateFormat, bool*): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeCosineCurve(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeSineCurve(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutSine(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutCurve(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutInSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutInSine(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutExpo(double): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutExpo(double): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qline.o:qline.cpp:function QLineF::angle() const: error: undefined reference to 'atan2'
    .obj/qline.o:qline.cpp:function QLineF::setAngle(double): error: undefined reference to 'sincos'
    .obj/qline.o:qline.cpp:function QLineF::fromPolar(double, double): error: undefined reference to 'sincos'
    .obj/qline.o:qline.cpp:function QLineF::angle(QLineF const&) const: error: undefined reference to 'acos'
    .obj/qlocale_tools.o:qlocale_tools.cpp:function qdtoa(double, int, int, int*, int*, char**, char**): error: undefined reference to 'feholdexcept'
    .obj/qlocale_tools.o:qlocale_tools.cpp:function qdtoa(double, int, int, int*, int*, char**, char**): error: undefined reference to 'fesetenv'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'floor'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'ceil'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'floor'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'ceil'
    .obj/qtimeline.o:qtimeline.cpp:function QTimeLine::frameForTime(int) const: error: undefined reference to 'ceil'
    collect2: error: ld returned 1 exit status
    Makefile:1213: recipe for target '../../lib/libQt5Core.so.5.5.1' failed
    make[2]: *** [../../lib/libQt5Core.so.5.5.1] Error 1
    make[2]: Leaving directory '/home/lyu/qt5_for_arm/qt-everywhere-opensource-src-5.5.1/qtbase/src/corelib'
    Makefile:170: recipe for target 'sub-corelib-make_first' failed
    make[1]: *** [sub-corelib-make_first] Error 2
    make[1]: Leaving directory '/home/lyu/qt5_for_arm/qt-everywhere-opensource-src-5.5.1/qtbase/src'
    Makefile:45: recipe for target 'sub-src-make_first' failed
    make: *** [sub-src-make_first] Error 2


    在最上面的那个问题出现的没有那个文件或者目录最后找的时候找到了,查找相关资料怀疑是raspbian用的gcc和工具链的gcc版本不一致,但是不知道对不对,我查过树莓派的gcc版本是4.9.2。交叉工具链的gcc版本是4.8.3,。但是在之前直接交叉编译一些小文件的时候是可以做到的,在pc编译传到树莓派运行,但是现在在交叉编译qt5的时候出现了问题。不知道有没有大神指教,才开始弄得这个东西,好多都还是不懂。

    回复

    使用道具 举报

  • TA的每日心情
    开心
    2016-3-27 09:49
  • 签到天数: 319 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2016-1-29 09:29:25 | 显示全部楼层
    看你的提示啊,它说 libz , libdl, librt,libm都没有,说明你没有安装,你要先安装一下 ,然后它指出的是  /mnt/raspberrypi2/usr/lib/arm-linux-gnueabihf/  ,说明是你的树莓派上没有安装,要在树莓派上这些lib文件,用 sudo apt-get install
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2016-2-1 18:06
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2016-1-29 12:44:19 | 显示全部楼层
    feiting94 发表于 2016-1-29 09:29
    看你的提示啊,它说 libz , libdl, librt,libm都没有,说明你没有安装,你要先安装一下 ,然后它指出的是  ...

    那个/mnt/raspberrypi2下面是挂载的从树莓派官网下的镜像文件呀,直接挂载的。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2016-2-1 18:06
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2016-1-29 15:07:54 | 显示全部楼层
    feiting94 发表于 2016-1-29 09:29
    看你的提示啊,它说 libz , libdl, librt,libm都没有,说明你没有安装,你要先安装一下 ,然后它指出的是  ...

    你看这是截图,我刚弄的,在它说没有的地方我实际上找到了!
    2016-01-29 15-03-15屏幕截图.png
    2016-01-29 15-03-56屏幕截图.png
    2016-01-29 15-04-23屏幕截图.png
    2016-01-29 15-05-17屏幕截图.png
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2016-3-27 09:49
  • 签到天数: 319 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2016-1-29 16:16:19 | 显示全部楼层
    creepsl 发表于 2016-1-29 15:07
    你看这是截图,我刚弄的,在它说没有的地方我实际上找到了!

    你的ubuntu用的是64还是32位系统啊,感觉和这个有关
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2016-2-1 18:06
  • 签到天数: 2 天

    连续签到: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2016-1-30 18:56:21 | 显示全部楼层
    feiting94 发表于 2016-1-29 16:16
    你的ubuntu用的是64还是32位系统啊,感觉和这个有关

    32位的,最后问题找出来了。找不到的那几个文件是用绝对路径指向的一个链接文件,所以找不到,用权限复制了一个到相应的目录下,最后make成功,昨天晚上全部编译完成。但是没有测试是否成功。
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-11-19 09:20 , Processed in 0.187031 second(s), 26 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.