Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

when execute qt app , " make " occure error .



  • HI ALL :

    qmake -project ...
    .......
    make

    log :

    cc@ubuntu:/usr/local/Qt-5.2.0/lib$ sudo make
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -Wl,-O1 -o lib hello.o -lQt5Widgets -L/usr/lib/i386-linux-gnu -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libQt5Widgets.so when searching for -lQt5Widgets
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lQt5Widgets
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libQt5Gui.so when searching for -lQt5Gui
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lQt5Gui
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libQt5Core.so when searching for -lQt5Core
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lQt5Core
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libGL.so when searching for -lGL
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lGL
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libpthread.so when searching for -lpthread
    /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libpthread.a when searching for -lpthread
    collect2: error: ld returned 1 exit status
    make: *** [lib] Error 1

    thanks !


  • Moderators

    @The-most-recent-future said in when execute qt app , " make " occure error .:

    arm-linux-gnueabihf

    This refers to toolchains/libraries that target the ARM architecture (for embedded devicecs)

    i386-linux-gnu

    This refers to toolchains/libraries that target the x86 architecture (for desktop PCs)

    ======
    Your issue is this: You are calling an ARM compiler, but it is finding x86 libraries. They are not compatible

    Are you trying to compile for your desktop, or for an embedded device?



  • @JKSH
    thanks.
    for embedded device.


  • Lifetime Qt Champion

    @The-most-recent-future Then link against ARM libraries not x86.
    Also: why do you build as root (sudo make)?!
    This is completely unnecessary and dangerous.



  • @jsulm
    thanks!



  • @jsulm
    Compiler success 【make and make install no error 】, how to verify correct


  • Lifetime Qt Champion

    @The-most-recent-future How to verify? Run it on the target device...



  • @jsulm
    how to run?

    qmake -v :
    Using Qt version 5.2.1 in /usr/lib/i386-linux-gnu
    ????
    my Qt version is 5.2.0 , cross compile version is arm-linux-g++ ,not i386 ..............
    why ?


  • Lifetime Qt Champion

    @The-most-recent-future I don't understand: you just said that you built successfully? So: did you built or not?
    Which qmake did you use? You need to use qmake from your crosscompiled Qt, not the one from your x86 host Qt.
    "qmake -v" - this is your host x86 qmake, use the one from crosscompiled Qt (use complete path to it).


  • Moderators

    @The-most-recent-future said in when execute qt app , " make " occure error .:

    qmake -v :
    Using Qt version 5.2.1 in /usr/lib/i386-linux-gnu

    This means, when you call qmake from the console, you are calling the x86 qmake.

    @The-most-recent-future said in when execute qt app , " make " occure error .:

    qmake -project ...

    You are calling the x86 qmake. That's why you got errors.

    You need to call your ARM qmake instead.


  • Lifetime Qt Champion

    Hi,

    To add to @JKSH and @jsulm : use the full path to the qmake executable you want to use when you're working with the command line.


Log in to reply