Qmake library path for arm project



  • I'm using qmake 2.01a and Qt 4.8.4 on a x86 Linux host. I'm having an issue unsetting the default library path when making a bin for an arm target.

    qmake adds -L/usr/lib/i386-linux-gnu to the link command even if I override it using LIBS = in the .pro

    I also was not able to remove the default qmake -unset QT_INSTALL_LIBS

    Below is part of my .pro project file.

    LIBS = -L/arm/libs

    QMAKE_CC = /arm/gcc-arm-none-eabi/bin/arm-none-eabi-gcc
    QMAKE_CXX = /arm/gcc-arm-none-eabi/bin/arm-none-eabi-g++
    QMAKE_LINK = /arm/gcc-arm-none-eabi/bin/arm-none-eabi-ld
    QMAKE_AR_CMD = /arm/gcc-arm-none-eabi/bin/arm-none-eabi-ar

    QMAKE_CFLAGS_DEBUG += -std=c99
    QMAKE_CFLAGS_RELEASE += -std=c99


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Are you trying to cross-compile your application using your x86 Qt qmake ?



  • Yes, I'm trying to build a binary for an arm Cortex device and running the development environment on x86 Mint.


  • Lifetime Qt Champion

    Did you first cross-compile Qt ?

    Without that you won't be able to cross-compile your application. Using your x86 qmake won't allow you to build an ARM application, you have to use the one from the ARM Qt



  • I'm confused. qmake has dependencies on Qt?

    My target application won't have any dependancies on Qt.

    qmake seems to work fine other than I can't get it to drop the reference to /usr/lib/i386-linux-gnu when linking.


  • Lifetime Qt Champion

    Indeed it has, qmake is the first thing built when building Qt.

    It's because you are using your system qmake which is configured to use your system build tools.

    You would at least need to tell it which mkspec to use (however I can't guarantee that i'll work without a glitch since I have always used qmake from my cross-compiled Qt when working on ARM code)



  • I don't understand why paths would be compiled into qmake, doesn't that make it much less flexible?

    It seems I may not be able to used qmake

    Thanks for your help.


  • Lifetime Qt Champion

    AFAIK it's so because then you don't need to mess around with your system to build a Qt project. But you can modify the paths qmake uses using e.g. qt.conf.

    However you didn't answer my question: did you already cross-compile Qt ?



  • Can you please explain procedure to cross compile QT4.8 for arm.????


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    There's already explanations in Qt's documentation. Note that ARM is a processor architecture. Depending on what target board you are using, little things might change.


Log in to reply
 

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