⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Something is adding a "-L/usr/local/lib" to the directfb test for cross compiling.

  • Hi,

    I'm trying to build an embedded Qt with this command,
    ./configure -platform linux-g++-64 -xplatform qws/linux-x86-intelce-g++ -embedded x86 -qt-gfx-directfb -v -opensource -confirm-license

    I'm using Ubuntu 64 bit but building for intelce which is 32bit x86. The test for direc fb is failing because "-L/usr/local/lib" is being added to the makery for the test, and it's finding the 64 bit libpthread and failing.

    my qmake.conf for the qws/linux-x86-intelce-g++ target is defining as
    QT_LIBS_DIRECTFB = -L/usr/local/cross/staging/current/lib -L/usr/local/cross/staging/current/usr/lib -L/usr/local/cross/staging/current/usr/local/lib -ldirectfb -lfusion -ldirect -lpthread -Wl,-rpath-link,/usr/local/cross/staging/current/lib

    The verbose and error output of configure is:
    i686-cm-linux-g++ -m32 -L/usr/local/cross/staging/current/lib -L/usr/local/cross/staging/current/usr/lib -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.7.1-i386/lib -o directfb directfb.o -L/usr/local/lib -L/usr/local/cross/staging/current/lib -L/usr/local/cross/staging/current/usr/lib -L/usr/local/cross/staging/current/usr/local/lib -ldirectfb -lfusion -ldirect -lpthread -Wl,-rpath-link,/usr/local/cross/staging/current/lib
    /lib/libpthread.so.0: file not recognized: File format not recognized
    collect2: ld returned 1 exit status
    make: *** [directfb] Error 1
    DirectFB disabled.
    The DirectFB screen driver functionality test failed!

    Any idea where the LIBDIR for /usr/local/lib is added and how I can remove it? I tried just removing it from the makefile, but the makefile is generated every time configure is run, I haven't been able to find out what it is being created from.

    Ken R

  • The linker error itself is:

    /lib/libpthread.so.0: file not recognized: File format not recognized

    The error happens because the linker is trying to use the wrong libpthread for cross compilation.

  • @anselmolsm Any idea what I'm doing wrong that's causing it to use the wrong lib?

  • @KennethR, do you have a libpthread built for the target platform? It seems it is not in any of the directories informed to the linker with -L, so it tries to find in the default paths (e.g. /lib). Check that, your cross compilation environment probably has this library.

  • I did have a libpthread built for the target, I was able to get Qt to build correctly by adding a --sysroot=/usr/local/cross/staging/current to the QT_LIBS_DIRECTFB variable in my qmake.conf.

Log in to reply