Build Qt with X11 for arm



  • Hi,
    I want to build qt for arm with X11 support.
    I have my rootfs with X11 libraries and header files.
    I am trying to configure qt with following option:
    ./configure -arch arm -xplatform qws/linux-arm-g++ -prefix /mnt/suraj_R_D/install -platform linux-g++ -little-endian -armfpa -no-sm -force-pkg-config -silent -v

    But still error occurs:
    compiling xlib.cpp
    linking xlib
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libXau.so.6, needed by /mnt/suraj_R_D/rootfs/usr/lib/libXext.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libxcb-xlib.so.0, needed by /mnt/suraj_R_D/rootfs/usr/lib/libX11.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libxcb.so.1, needed by /mnt/suraj_R_D/rootfs/usr/lib/libX11.so, not found (try using -rpath or -rpath-link)
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_connection_has_error' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_xlib_lock'
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_poll_for_reply' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_get_maximum_request_length'
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_xlib_unlock' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_get_file_descriptor'
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_connect' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_wait_for_reply'
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_get_setup' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_send_request'
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_wait_for_event' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_flush'
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_poll_for_event' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_parse_display'
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_generate_id' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_disconnect'
    /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference to xcb_get_request_sent' /mnt/suraj_R_D/rootfs/usr/lib/libX11.so: undefined reference toxcb_connect_to_display_with_auth_info'
    collect2: ld returned 1 exit status
    make: *** [xlib] Error 1
    XLib disabled.
    Basic XLib functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /mnt/suraj_R_D/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-arm-g++.

    and my qmake.conf is as follows:

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

    include(../../common/linux.conf)
    include(../../common/gcc-base-unix.conf)
    include(../../common/g++-unix.conf)
    include(../../common/qws.conf)

    modifications to g++.conf

    QMAKE_CC = arm-fsl-linux-gnueabi-gcc
    QMAKE_CXX = arm-fsl-linux-gnueabi-g++
    QMAKE_LINK = arm-fsl-linux-gnueabi-g++
    QMAKE_LINK_SHLIB = arm-fsl-linux-gnueabi-g++

    modifications to linux.conf

    QMAKE_AR = arm-fsl-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY = arm-fsl-linux-gnueabi-objcopy
    QMAKE_STRIP = arm-fsl-linux-gnueabi-strip

    QMAKE_INCDIR = /mnt/suraj_R_D/rootfs/usr/include
    QMAKE_LIBDIR = /mnt/suraj_R_D/rootfs/usr/lib

    load(qt_config)

    qws.conf:

    qmake configuration common for QWS

    MAKEFILE_GENERATOR = UNIX
    TARGET_PLATFORM = unix
    TEMPLATE = app
    CONFIG += qt warn_on release incremental link_prl
    QT += core gui network
    QMAKE_INCREMENTAL_STYLE = sublib

    modifications to linux.conf

    QMAKE_INCDIR_X11 = /mnt/suraj_R_D/rootfs/usr/include/X11
    QMAKE_LIBDIR_X11 = /mnt/suraj_R_D/rootfs/usr/lib/X11
    QMAKE_INCDIR_OPENGL =
    QMAKE_LIBDIR_OPENGL =
    QMAKE_INCDIR_OPENGL_ES1 =
    QMAKE_LIBDIR_OPENGL_ES1 =
    QMAKE_INCDIR_OPENGL_ES2 =
    QMAKE_LIBDIR_OPENGL_ES2 =
    QMAKE_LIBS_X11 = -lXext -lX11 -lm
    QMAKE_LIBS_X11SM =


  • Moderators

    -Looks like you are mixing 2 different versions of Qt (4.6.2 and 4.8.0).- Doh, sorry. You are obviously using GCC 4.6.2 and Qt 4.8.0... that is perfectly fine.

    Also, since you want to use X11, you should not compile QWS.



  • Thanks sierdzio.

    Now i am using qt-everywhere-opensource-src-4.8.0. I have created linux-arm-g++ in mkspec folder where i am not using qws.
    But still i get the same error.

    qmake file content as follows:

    qmake configuration for linux-g++

    MAKEFILE_GENERATOR = UNIX
    TARGET_PLATFORM = unix
    TEMPLATE = app
    CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
    QT += core gui
    QMAKE_INCREMENTAL_STYLE = sublib

    include(../common/linux.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.conf)

    modifications to g++.conf

    QMAKE_CC = arm-fsl-linux-gnueabi-gcc
    QMAKE_CXX = arm-fsl-linux-gnueabi-g++
    QMAKE_LINK = arm-fsl-linux-gnueabi-g++
    QMAKE_LINK_SHLIB = arm-fsl-linux-gnueabi-g++

    QMAKE_INCDIR = /srv/rootfs/usr/include
    QMAKE_LIBDIR = /srv/rootfs/usr/lib

    QMAKE_INCDIR_X11 = /srv/rootfs/usr/include/X11
    QMAKE_LIBDIR_X11 = /srv/rootfs/usr/lib/X11

    modifications to linux.conf

    QMAKE_AR = arm-fsl-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY = arm-fsl-linux-gnueabi-objcopy
    QMAKE_STRIP = arm-fsl-linux-gnueabi-strip

    load(qt_config)

    confilguration line is:
    ./configure -arch arm -opensource -confirm-license -nomake demos -nomake examples -nomake docs -no-qt3support -release -xplatform linux-arm-g++ -exceptions -make tools -make libs -little-endian -v

    following error is shown:

    Detecting broken X11 headers... (/mnt/qt-everywhere-opensource-src-4.8.0/mkspecs/linux-arm-g++ yes /mnt/qt-everywhere-opensource-src-4.8.0 /mnt/qt-everywhere-opensource-src-4.8.0)
    X11 headers look good.
    XLib auto-detection... ()
    arm-fsl-linux-gnueabi-g++ -c -pipe -O2 -Wall -W -I../../../mkspecs/linux-arm-g++ -I. -I/srv/rootfs/usr/include/X11 -I/srv/rootfs/usr/include -o xlib.o xlib.cpp
    arm-fsl-linux-gnueabi-g++ -Wl,-O1 -o xlib xlib.o -L/srv/rootfs/usr/lib -L/srv/rootfs/usr/lib/X11 -lXext -lX11 -lm
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libXau.so.6, needed by /srv/rootfs/usr/lib/libXext.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libxcb-xlib.so.0, needed by /srv/rootfs/usr/lib/libX11.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libxcb.so.1, needed by /srv/rootfs/usr/lib/libX11.so, not found (try using -rpath or -rpath-link)
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_connection_has_error' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_xlib_lock'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_poll_for_reply' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_get_maximum_request_length'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_xlib_unlock' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_get_file_descriptor'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_connect' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_wait_for_reply'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_get_setup' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_send_request'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_wait_for_event' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_flush'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_poll_for_event' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_parse_display'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_generate_id' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_disconnect'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_get_request_sent' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_connect_to_display_with_auth_info'
    collect2: ld returned 1 exit status
    make: *** [xlib] Error 1
    XLib disabled.
    Basic XLib functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /mnt/qt-everywhere-opensource-src-4.8.0/mkspecs/linux-arm-g++.

    Need help for the same.


  • Moderators

    I strongly suggest updting to Qt 4.8.6 - a huge amount of bug fixes has gone into the software beweeem 4.8.0 ad 4.8.6.

    It seems your problem is very similar to "this":http://stackoverflow.com/questions/15365649/compiling-xkbcomp-xorg-app.

    I think you have X11, but you have missed the xcb libraries.



  • I have changed qt version to 4.8.6.
    I have also changed
    QMAKE_LIBS_X11 = -lxcb -lX11

    Error as follows:

    XLib auto-detection... ()
    arm-fsl-linux-gnueabi-g++ -c -pipe -O2 -Wall -W -I../../../mkspecs/linux-arm-g++ -I. -I/srv/rootfs/usr/include/X11 -I/srv/rootfs/usr/include -o xlib.o xlib.cpp
    arm-fsl-linux-gnueabi-g++ -Wl,-O1 -o xlib xlib.o -L/srv/rootfs/usr/lib -L/srv/rootfs/usr/lib/X11 -lxcb -lX11
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libXau.so.6, needed by /srv/rootfs/usr/lib/libxcb.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libxcb-xlib.so.0, needed by /srv/rootfs/usr/lib/libX11.so, not found (try using -rpath or -rpath-link)
    /srv/rootfs/usr/lib/libX11.so: undefined reference to xcb_xlib_lock' /srv/rootfs/usr/lib/libX11.so: undefined reference toxcb_xlib_unlock'
    /srv/rootfs/usr/lib/libxcb.so: undefined reference to XauDisposeAuth' /srv/rootfs/usr/lib/libxcb.so: undefined reference toXauGetBestAuthByAddr'
    /srv/rootfs/usr/lib/libX11.so: undefined reference to `xcb_get_request_sent'
    collect2: ld returned 1 exit status
    make: *** [xlib] Error 1
    XLib disabled.

    I have both X11 and xcb libraries.
    libXau.so.6 and libxcb-xlib.so.0 exists in the include directory .
    It is built for same arm architecture.


  • Moderators

    Should work, then. However, the linker is probably linear, and the order in which you include libraries is important. So possibly you need to make sure xcb gets linked before X11. I'm just guessing.



  • Hi,
    I have changed QMAKE_LIBS_X11 parameter in qmake.conf file as follows:
    @
    QMAKE_LIBS_X11 = -lxcb -lX11 -lXau -lxcb-xlib -lXext -lSM -lICE -lXrandr /srv/rootfs/usr/lib/libxcb.so.1 /srv/rootfs/usr/lib/libX11.so.6 /srv/rootfs/usr/lib/libXau.so.6 /srv/rootfs/usr/lib/libxcb-xlib.so.0 /srv/rootfs/usr/lib/libXext.so.6 /srv/rootfs/usr/lib/libXrender.so.1
    @
    My configuration as follows:
    @
    ./configure -arch arm -opensource -confirm-license -nomake demos -nomake examples -nomake docs -no-qt3support -release -xplatform linux-arm-g++ -exceptions -make tools -make libs -little-endian -no-largefile -no-sql-sqlite2 -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-multimedia -no-audio-backend -no-webkit -qt-zlib -qt-libtiff -qt-libpng -qt-libjpeg -no-openssl -no-nis -no-cups -no-xshape -v
    @
    It is configuring correctly.But while make it shows following error:
    @
    opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libSM.so.6, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libICE.so.6, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libXrender.so.1, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libxcb.so.1, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libX11.so.6, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libXau.so.6, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libxcb-xlib.so.0, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libXext.so.6, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libXrandr.so.2, needed by /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
    /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference to XSetTile' /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference toXGetFontProperty'
    /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference to XRenderChangePicture' /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference toXCreateBitmapFromData'
    /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference to XSetStipple' /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference toXSetTransientForHint'
    /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference to XShmPutImage' /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference toXFlush'
    /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference to IceConnectionNumber' /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference toXCloseDisplay'
    /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference to XSync' /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference toXGetAtomName'
    /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference to XCheckIfEvent' /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference toXPutImage'
    /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference to XDrawString16' /mnt/qt-everywhere-opensource-src-4.8.6/lib/libQtGui.so: undefined reference toXListPixmapFormats'
    collect2: ld returned 1 exit status
    make[4]: *** [../../../../bin/assistant] Error 1
    make[4]: Leaving directory /mnt/qt-everywhere-opensource-src-4.8.6/tools/assistant/tools/assistant' make[3]: *** [sub-assistant-make_default-ordered] Error 2 make[3]: Leaving directory/mnt/qt-everywhere-opensource-src-4.8.6/tools/assistant/tools'
    make[2]: *** [sub-tools-make_default-ordered] Error 2
    make[2]: Leaving directory /mnt/qt-everywhere-opensource-src-4.8.6/tools/assistant' make[1]: *** [sub-assistant-make_default-ordered] Error 2 make[1]: Leaving directory/mnt/qt-everywhere-opensource-src-4.8.6/tools'
    make: *** [sub-tools-make_default-ordered] Error 2
    @



  • I have built successfully qt with X11 for arm by adding following into my spec file
    for LIB_X11
    -lxcb -lX11 -lXau -lxcb-xlib -lXext -lSM -lICE -lfreetype -lXrandr /srv/rootfs/usr/lib/libxcb.so.1 /srv/rootfs/usr/lib/libX11.so.6 /srv/rootfs/usr/lib/libXau.so.6 /srv/rootfs/usr/lib/libxcb-xlib.so.0 /srv/rootfs/usr/lib/libXext.so.6 /srv/rootfs/usr/lib/libXrender.so.1 /srv/rootfs/usr/lib/libz.so.1 -lXmu -lXft -lXt -lXrandr -lXrender -lXdamage -lxcb-damage -lxcb-composite -lxcb-randr -lxcb-xv -lxcb-xvmc -lxcb-xprint -lxcb-xtest -lxcb-xfixes -lxcb-xinerama -lxcb-xevie -lxcb-xf86dri -lxcb-shape -lxcb-shm -lxcb-sync -lxcb-render -lxcb-res -lxcb-screensaver -lxcb-dpms -lxcb-record -lxcb-glx -lXfixes -lXext -lX11-xcb -lX11 -lxcb -lXau -lXdmcp -lfontconfig -lfreetype -lexpat -lm -lz -lstdc++ -lglib-2.0 -lSM -lICE

    Thanks


  • Moderators

    Woah, congratulations! I'm happy it finally works for you.


Log in to reply
 

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