Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. libQt5Core.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
QtWS25 Last Chance

libQt5Core.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 2 Posters 8.0k Views
  • 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.
  • M Offline
    M Offline
    maikelo
    wrote on 11 Feb 2016, 16:44 last edited by maikelo 2 Nov 2016, 20:01
    #1

    Hello guys,

    I'm using a cross compiled qt 5.4.2 and I getting the following error when I try to build simple QtWidget app (the app is just a window)

    09:55:42: Running steps for project untitled...
    09:55:42: Configuration unchanged, skipping qmake step.
    09:55:42: Starting: "/usr/bin/make" 
    g++ --sysroot=/home/pf/ssdk-d6cx/host/usr/x86_64-buildroot-linux-gnu/sysroot -Wl,-O1 -Wl,-rpath,/usr/local/qt5.4-d6cx/lib -o untitled main.o mainwindow.o moc_mainwindow.o   -L/home/pf/ssdk-d6cx/host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/local/qt5.4-d6cx/lib -lQt5Widgets -L/home/pf/ssdk-d6cx/host/usr/x86_64-buildroot-linux-gnu/sysroot/lib64 -L/usr/local/qt5.4-d6cx/lib -lQt5Gui -lQt5Core -lGLESv2 -lpthread 
    /home/pf/ssdk-d6cx/host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/local/qt5.4-d6cx/lib/libQt5Core.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
    collect2: ld returned 1 exit status
    make: *** [untitled] Error 1
    09:55:42: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project untitled (kit: d6cx)
    When executing step "Make"
    09:55:42: Elapsed time: 00:00.
    

    I really don't understand what is going on.

    Could be a compatibility problem with some libs on the target OS?

    I will appreciate any help that point me to the solution.

    Thanks in advance.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 11 Feb 2016, 16:56 last edited by kshegunov 2 Nov 2016, 16:57
      #2

      @maikelo
      Hello,
      I don't see the standard C++ library linked on the linker step. Try adding -lstdc++, although this should've been done by qmake. Are you doing something "strange" with the project file? Are you using the cross compiled qmake?

      Kind regards.

      Read and abide by the Qt Code of Conduct

      M 1 Reply Last reply 11 Feb 2016, 17:13
      0
      • K kshegunov
        11 Feb 2016, 16:56

        @maikelo
        Hello,
        I don't see the standard C++ library linked on the linker step. Try adding -lstdc++, although this should've been done by qmake. Are you doing something "strange" with the project file? Are you using the cross compiled qmake?

        Kind regards.

        M Offline
        M Offline
        maikelo
        wrote on 11 Feb 2016, 17:13 last edited by
        #3

        @kshegunov thanks for your response. I'm not touching the project file. I just create a QtWidget App with a window and I'm trying to build it.

        Regarding qmake, yes I'm using a cross compiled qmake. When I run just qmake I got this output:

        11:09:39: Running steps for project untitled...
        11:09:39: Starting: "/usr/local/qt5.4-d6cx/bin/qmake" '/home/pf/D6Cx/test app/untitled/untitled.pro' -r -spec linux-g++
        11:09:39: The process "/usr/local/qt5.4-d6cx/bin/qmake" exited normally.
        11:09:39: Elapsed time: 00:00.
        

        Regarding to add -lstdc++, how should I do that?

        Thanks again!!

        K 1 Reply Last reply 11 Feb 2016, 17:17
        0
        • M maikelo
          11 Feb 2016, 17:13

          @kshegunov thanks for your response. I'm not touching the project file. I just create a QtWidget App with a window and I'm trying to build it.

          Regarding qmake, yes I'm using a cross compiled qmake. When I run just qmake I got this output:

          11:09:39: Running steps for project untitled...
          11:09:39: Starting: "/usr/local/qt5.4-d6cx/bin/qmake" '/home/pf/D6Cx/test app/untitled/untitled.pro' -r -spec linux-g++
          11:09:39: The process "/usr/local/qt5.4-d6cx/bin/qmake" exited normally.
          11:09:39: Elapsed time: 00:00.
          

          Regarding to add -lstdc++, how should I do that?

          Thanks again!!

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 11 Feb 2016, 17:17 last edited by
          #4

          @maikelo
          Hello,
          You could add in your project file:

          LIBS += -lstdc++
          

          But(!) take note that all this much depends on the target device and what it provides. You may need instead to compile everything without exception support (Qt included), if your device in fact can't handle those.

          Kind regards.

          Read and abide by the Qt Code of Conduct

          M 1 Reply Last reply 11 Feb 2016, 18:57
          0
          • K kshegunov
            11 Feb 2016, 17:17

            @maikelo
            Hello,
            You could add in your project file:

            LIBS += -lstdc++
            

            But(!) take note that all this much depends on the target device and what it provides. You may need instead to compile everything without exception support (Qt included), if your device in fact can't handle those.

            Kind regards.

            M Offline
            M Offline
            maikelo
            wrote on 11 Feb 2016, 18:57 last edited by
            #5

            @kshegunov I add -lstdc++ and continue the same error. I checked and the target OS has that lib. Also the Qt Framework I'm using was built for the target OS.

            I don't know if it is relevant but I already realize that when qmake run it use the following sequence:

            qmake '/home/pf/D6Cx/test app/untitled/untitled.pro' -r -spec linux-g++
            

            I mean, it is using -spec linux-g++ but when I built Qt I specified that the target device is linux-d6cx-g++, so my doubt is: should qmake use -spec linux-g++ or -spec linux-d6cx-g++ ?

            Thanks,

            K 1 Reply Last reply 11 Feb 2016, 19:41
            0
            • M Offline
              M Offline
              maikelo
              wrote on 11 Feb 2016, 19:38 last edited by
              #6

              I found the solution to the problem.

              The real problem was that I was using Qt Creator as IDE to cross compile and it set qmake to use a device different that the one I was cross compiling for.

              I mean the original setting for qmake was:

              qmake '/home/pf/D6Cx/test app/untitled/untitled.pro' -r -spec linux-g++
              

              and it should be:

              qmake '/home/pf/D6Cx/test app/untitled/untitled.pro' -r -spec devices/linux-d6cx-g++
              

              whith this last one configuration the app is built correctly!!

              The way I use to force qmake to use my specific device was (in Qt Creator):

              • go to Projects/Build setting
              • in the section Build Steps -> qmake add in Additional arguments:
                -spec devices/linux-d6cx-g++
                and that will overwrite the original setting for -spec

              Thanks!

              1 Reply Last reply
              0
              • M maikelo
                11 Feb 2016, 18:57

                @kshegunov I add -lstdc++ and continue the same error. I checked and the target OS has that lib. Also the Qt Framework I'm using was built for the target OS.

                I don't know if it is relevant but I already realize that when qmake run it use the following sequence:

                qmake '/home/pf/D6Cx/test app/untitled/untitled.pro' -r -spec linux-g++
                

                I mean, it is using -spec linux-g++ but when I built Qt I specified that the target device is linux-d6cx-g++, so my doubt is: should qmake use -spec linux-g++ or -spec linux-d6cx-g++ ?

                Thanks,

                K Offline
                K Offline
                kshegunov
                Moderators
                wrote on 11 Feb 2016, 19:41 last edited by kshegunov 2 Nov 2016, 19:42
                #7

                @maikelo

                I mean, it is using -spec linux-g++ but when I built Qt I specified that the target device is linux-d6cx-g++, so my doubt is: should qmake use -spec linux-g++ or -spec linux-d6cx-g++ ?

                I would think so, yes.

                EDIT:
                You seem to have found the solution on your own before my view updated, so the above comment is pretty useless. Anyway, good luck!

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                1

                7/7

                11 Feb 2016, 19:41

                • Login

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