QT base compiling error



  • Hi,
    I have used the instructions in link below for cross compile QT creator. While qt base compiling, i got the errors below after "make -j 4":

    http://wiki.qt.io/RaspberryPi_Beginners_Guide

    collect2: error: ld returned 1 exit status
    Makefile:680: recipe for target '../../lib/libQt5Core.so.5.0.2' failed
    make[2]: *** [../../lib/libQt5Core.so.5.0.2] Error 1
    make[2]: Leaving directory '/home/eray/Raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src/corelib'
    Makefile:75: recipe for target 'sub-corelib-make_first' failed
    make[1]: *** [sub-corelib-make_first] Error 2
    make[1]: Leaving directory '/home/eray/Raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src'
    Makefile:40: recipe for target 'sub-src-make_first' failed
    make: *** [sub-src-make_first] Error 2
    
    

    What can i do for solving this problem?


  • Qt Champions 2016

    Hello,
    When did you pull from the repository? I was not able to build it with the last commit as well. I guess some patience is advised until they fix up the problem. Is there any specific reason you want Qt 5.6, since it's not really released yet?

    Kind regards.



  • As mentioned there, ( "As gitorious is offline I used the following path instead: https://github.com/shahriman/cross-compile-tools.git") i have pulled from the link they have given : https://github.com/shahriman/cross-compile-tools.git

    By the way, sorry for wrong output, because i have tried somethings about building it so, the error output is below:

    collect2: error: ld returned 1 exit status
    Makefile:680: recipe for target '../../lib/libQt5Core.so.5.0.2' failed
    make[2]: *** [../../lib/libQt5Core.so.5.0.2] Error 1
    make[2]: Leaving directory '/home/eray/Raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src/corelib'
    Makefile:75: recipe for target 'sub-corelib-make_first' failed
    make[1]: *** [sub-corelib-make_first] Error 2
    make[1]: Leaving directory '/home/eray/Raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src'
    Makefile:40: recipe for target 'sub-src-make_first' failed
    make: *** [sub-src-make_first] Error 2
    
    

  • Qt Champions 2016

    @rapid84
    You seem to have problems with compiling Qt, but you've not given the exact error in the make output, why not download a precompiled binary and take it from there? Here's a guide I was able to find on a site for the raspberry. If you still want to compile Qt use one of the official repositories and you can look up this guide or this one. If you want to try and diagnose why Qt is not building, go up in your make output and find the exact error (either the compiler or linker should be complaining somewhere), usually the problem is an unmet dependency.

    Kind regards.



  • @kshegunov
    I will try the links that you have given and the exact error in the make output :

    .obj/release-shared/qlibrary_unix.o: In function `QLibraryPrivate::load_sys()':
    qlibrary_unix.cpp:(.text+0x1230): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libdl.a(dlopen.o): In function `dlopen':
    (.text+0xc): undefined reference to `__dlopen'
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libdl.a(dlclose.o): In function `dlclose':
    (.text+0x0): undefined reference to `__dlclose'
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libdl.a(dlsym.o): In function `dlsym':
    (.text+0xc): undefined reference to `__dlsym'
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libdl.a(dlerror.o): In function `dlerror':
    (.text+0x0): undefined reference to `__dlerror'
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libm.a(feholdexcpt.o): In function `feholdexcept':
    (.text+0x48): undefined reference to `_dl_hwcap'
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libm.a(fesetenv.o): In function `fesetenv':
    (.text+0x64): undefined reference to `_dl_hwcap'
    collect2: error: ld returned 1 exit status
    Makefile:666: recipe for target '../../lib/libQt5Core.so.5.0.2' failed
    make[2]: *** [../../lib/libQt5Core.so.5.0.2] Error 1
    make[2]: Leaving directory '/home/eray/Raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src/corelib'
    Makefile:75: recipe for target 'sub-corelib-make_first' failed
    make[1]: *** [sub-corelib-make_first] Error 2
    make[1]: Leaving directory '/home/eray/Raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src'
    Makefile:40: recipe for target 'sub-src-make_first' failed
    make: *** [sub-src-make_first] Error 2
    
    

  • Qt Champions 2016

    @rapid84
    I've never worked with rpi but you obviously have some linker error ... for some reason ... are you by chance building statically? If yes, don't, usually static builds are much more harder to handle and satisfy than dynamic libraries. Aside from that, I can't offer much more, just look up the RaspberryPI guide I've linked in my previous post, it looks very good, and maybe someone will pitch in and suggest something else.

    Kind regards.



  • @kshegunov
    I have just done what the instruction is and how i could build it staticly "by chance" ? By the way i have done the instructions that you have given me ( http://exploreembedded.tumblr.com/post/115333857238/guide-to-cross-compile-qt-54-for-the-raspberry-pi) and i got the nearly same error after "make" :

    ~/rpi-tool/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/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libm.so: No such file or directory
    .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::DateFormat, bool*): error: undefined reference to 'pow'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt::DateFormat, bool*): error: undefined reference to 'floorf'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt::DateFormat, bool*): error: undefined reference to 'pow'
    .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 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 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 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'
    .obj/qelapsedtimer_unix.o:qelapsedtimer_unix.cpp:function qt_gettime(): error: undefined reference to 'clock_gettime'
    .obj/qelapsedtimer_unix.o:qelapsedtimer_unix.cpp:function QElapsedTimer::start(): error: undefined reference to 'clock_gettime'
    .obj/qelapsedtimer_unix.o:qelapsedtimer_unix.cpp:function QElapsedTimer::restart(): error: undefined reference to 'clock_gettime'
    .obj/qelapsedtimer_unix.o:qelapsedtimer_unix.cpp:function QElapsedTimer::nsecsElapsed() const: error: undefined reference to 'clock_gettime'
    collect2: error: ld returned 1 exit status
    Makefile:1255: recipe for target '../../lib/libQt5Core.so.5.4.2' failed
    make[3]: *** [../../lib/libQt5Core.so.5.4.2] Error 1
    make[3]: Leaving directory '/home/eray/Qt/5.4/Src/qtbase/src/corelib'
    Makefile:142: recipe for target 'sub-corelib-make_first' failed
    make[2]: *** [sub-corelib-make_first] Error 2
    make[2]: Leaving directory '/home/eray/Qt/5.4/Src/qtbase/src'
    Makefile:45: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/eray/Qt/5.4/Src/qtbase'
    Makefile:68: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2
    
    

  • Qt Champions 2016

    @rapid84
    Hello,

    how i could build it staticly "by chance" ?

    I meant it in its idiomatic meaning: "by any chance - used in enquiring about the possibility of something", not that you're doing that accidentally. :)

    i got the nearly same error after "make"

    This error I understand, although I have no idea why you get it. The problem is that the linker can't find the libm.so file (the math library). That's why it's giving you tons of undefined references. If I were to hazard a guess, there is some misconfiguration of the library paths and the linker is unable to find the library binary. I hope this helps.

    Kind regards.



  • I have solved this problem. The problem originated by fixQualifiedLibraryPaths script , i have used it wrongly so there were broken symbolink links in rootfs.



  • hi! Please can you tell me how did you fix it exactly? I have the same error and i still struggle with it :/


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.