Cross compiling Qt 5.5.1 for armhf on Ubuntu 15.10

  • Hello!

    I'm trying to cross compile Qt 5.5.1 for armhf on Ubuntu 15.10.

    I've downloaded qt 5.5.1 and extracted it in a directory.

    I have installed all the required packages. (I think.)

    I copied the arm-linux-gnueabi-g++ and named it arm-linux-gnueabihf-g++.

    I changed "arm-linux-gnueabihf-g++/qmake.conf" so that it looks like this:

    # qmake configuration for building with arm-linux-gnueabihf-g++
    CONFIG                 += incremental
    # modifications to g++.conf
    QMAKE_CC                = arm-linux-gnueabihf-gcc
    QMAKE_CXX               = arm-linux-gnueabihf-g++
    QMAKE_LINK              = arm-linux-gnueabihf-g++
    QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++
    # modifications to linux.conf
    QMAKE_AR                = arm-linux-gnueabihf-ar cqs
    QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
    QMAKE_NM                = arm-linux-gnueabihf-nm -P
    QMAKE_STRIP             = arm-linux-gnueabihf-strip

    And I run this command in the qt-everywhere-opensource-src-5.5.1 directory:

    ./configure -opensource -confirm-license -platform linux-arm-gnueabihf-g++ -release -prefix /usr/local/Qt-5.5.1-arm -qt-xcb -L/usr/arm-linux-gnueabihf/lib -v

    But I get the following error:

    qt-everywhere-opensource-src-5.5.1/qtbase/bin/qmake: error while loading shared libraries: cannot open shared object file: No such file or directory

    I have checked and /usr/arm-linux-gnueabihf/lib/ does exist.

    What am I doing wrong?

    Best Regards
    / Rasmus

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You are missing a space between -L and the path.

  • Hello and thank you!

    I added a space where you suggested, but unfortunately it didn't help.

    I must be doing (or not doing) some other thing wrong.

    I come across the name "fixQualifiedLibraryPaths" time after time, is that something that would help?
    Is is universal or device specific?

    Best Regards
    / Rasmus

  • I have tried some more now, still I get the same error.

    I noticed that it seems that ./configure knows about the path to the library, it's one of the first outputs from the configuration:

    Precompiled-headers support enabled.
    arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c
    Symbol visibility control enabled.
    arm-linux-gnueabihf-g++ -o -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
    bsymbolic_functions.c:2:2: error: #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
     #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
    Symbolic function binding disabled.
    Creating qmake...

    I noticed an error message, but it seems it have been for a while.

    Best Regards
    / Rasmus

  • I put the output from configure in a pastebin: (This will work in 1 month from today.)

    Best Regards
    / Rasmus

  • Lifetime Qt Champion

    Are you cross-compiling for the Raspberry Pi ?

    In any case, what do you get if your run ldd on qmake ?

  • It's not a raspberry pi, but it is a small SBC.

    I manage to solve the problem, I had missed the "-xplatform" argument.

    Best Regards
    / Rasmus

  • Lifetime Qt Champion

    Good catch !

    I missed that one on your configure line.

    Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)