Problem building embedded qt version

  • version : qt embedded 4.6.3

    I'm currently trying to cross compile qt for our i.MX27 processor board. It goes well for a long time but finally fails on a linker issue when building one of the example applications :

    @arm-none-linux-gnueabi-g++ -Wl,-rpath-link,/home/filip/QT/qt-embedded-4.6.3/lib -fno-exceptions -Wl,-O1 -o animatedtiles .obj/release-shared-emb-arm/main.o .obj/release-shared-emb-arm/qrc_animatedtiles.o -L/home/filip/QT/qt-embedded-4.6.3/lib -L/home/filip/i.MX27/ltib/rootfs/usr/lib -lQtGui -L/home/filip/QT/qt-embedded-4.6.3/lib -L/home/filip/i.MX27/ltib/rootfs/usr/lib -lQtNetwork -lQtCore -lglib-2.0 -lgthread-2.0 -lgstreamer-0.10 -lxml2 -lz -lgmodule-2.0 -lgobject-2.0 -lts -lasound -lpthread
    /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/gcc/arm-none-linux-gnueabi/4.1.2/../../../../arm-none-linux-gnueabi/bin/ld: warning:, needed by /home/filip/QT/qt-embedded-4.6.3/lib/, not found (try using -rpath or -rpath-link)
    /home/filip/QT/qt-embedded-4.6.3/lib/ undefined reference to png_error' /home/filip/QT/qt-embedded-4.6.3/lib/ undefined reference topng_set_gAMA'
    /home/filip/QT/qt-embedded-4.6.3/lib/ undefined reference to png_set_text' /home/filip/QT/qt-embedded-4.6.3/lib/ undefined reference topng_set_strip_16'
    /home/filip/QT/qt-embedded-4.6.3/lib/ undefined reference to png_set_error_fn' /home/filip/QT/qt-embedded-4.6.3/lib/ undefined reference topng_read_end'
    collect2: ld returned 1 exit status
    make[3]: *** [animatedtiles] Error 1
    make[3]: Leaving directory /home/filip/QT/qt-embedded-4.6.3/examples/animation/animatedtiles' make[2]: *** [sub-animatedtiles-make_default] Error 2 make[2]: Leaving directory/home/filip/QT/qt-embedded-4.6.3/examples/animation'
    make[1]: *** [sub-animation-make_default] Error 2
    make[1]: Leaving directory `/home/filip/QT/qt-embedded-4.6.3/examples'
    make: *** [sub-examples-make_default-ordered] Error 2
    Obviously, the linker does not find the library. However, the linker options contain this line :

    @ -L/home/filip/i.MX27/ltib/rootfs/usr/lib@

    and when I list the files from that folder, I see is present in that location :

    @filip@thc-ubuntu-2:~/QT/qt-embedded-4.6.3$ ls -al /home/filip/i.MX27/ltib/rootfs/usr/lib | grep libpng

    -rw-r--r-- 1 root root 278528 2010-08-20 13:51 libpng12.a
    lrwxrwxrwx 1 root root 13 2010-08-20 13:51 ->
    lrwxrwxrwx 1 root root 19 2010-08-20 13:51 ->
    -rwxr-xr-x 1 root root 251548 2010-08-20 13:51
    lrwxrwxrwx 1 root root 10 2010-08-20 13:51 libpng.a -> libpng12.a
    lrwxrwxrwx 1 root root 11 2010-08-20 13:51 ->
    lrwxrwxrwx 1 root root 17 2010-08-20 13:51 ->
    -rwxr-xr-x 1 root root 251548 2010-08-20 13:51

    What do I miss here ? (I think something simple...but right now, I don't see it...)
    (One thing I can think of is the version of the libpng library, but I guess I would get another error message in that case ...)

    Anyone can point me in the good direction ? Any hints ?

    Thanks !

    Might be important too : this is how my 'custom' .conf file looks like :


    qmake configuration for building with arm-none-linux-gnueabi-g++


    QMAKE_CC = arm-none-linux-gnueabi-gcc
    QMAKE_CXX = arm-none-linux-gnueabi-g++
    QMAKE_LINK = arm-none-linux-gnueabi-g++
    QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
    QMAKE_LINK_C = arm-none-linux-gnueabi-gcc
    QMAKE_LINK_C_SHLIB = arm-none-linux-gnueabi-gcc

    QMAKE_INCDIR = /home/filip/i.MX27/ltib/rootfs/usr/include
    QMAKE_LIBDIR = /home/filip/i.MX27/ltib/rootfs/usr/lib

    QMAKE_LIBS = -lglib-2.0 -lgthread-2.0 -lgstreamer-0.10 -lxml2 -lz -lgmodule-2.0 -lgobject-2.0 -lts -lasound
    QMAKE_LIBS_X11 =

    QMAKE_AR = arm-none-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
    QMAKE_RANLIB = arm-none-linux-gnueabi-ranlib

    QMAKE_STRIP = arm-none-linux-gnueabi-strip


  • -lpng is missing from your linker line, add it to QMAKE_LIBS in your custom conf file.

  • Yes ! That's it !

    Thank You !!

Log in to reply

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