Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT base compiling error
Forum Updated to NodeBB v4.3 + New Features

QT base compiling error

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 7.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rapid84
    wrote on last edited by rapid84
    #1

    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?

    1 Reply Last reply
    0
    • kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      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.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rapid84
        wrote on last edited by rapid84
        #3

        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
        
        
        kshegunovK 1 Reply Last reply
        0
        • R rapid84

          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
          
          
          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by kshegunov
          #4

          @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.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rapid84
            wrote on last edited by
            #5

            @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
            
            
            1 Reply Last reply
            0
            • kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by
              #6

              @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.

              Read and abide by the Qt Code of Conduct

              1 Reply Last reply
              0
              • R Offline
                R Offline
                rapid84
                wrote on last edited by rapid84
                #7

                @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
                
                
                kshegunovK 1 Reply Last reply
                0
                • R rapid84

                  @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
                  
                  
                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by
                  #8

                  @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.

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    rapid84
                    wrote on last edited by
                    #9

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

                    1 Reply Last reply
                    0
                    • boutheinaB Offline
                      boutheinaB Offline
                      boutheina
                      wrote on last edited by
                      #10

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

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved