Want to set up Qt5 for developing application in Wandboard



  • Hi All,

    I am working on Wandboard Solo. I am developing my application in Ubuntu for that i want to set up Qt5 for wandboard. I learn how to create new project using Qt Creater, but i am getting stuck at qmake configuration. I am not able to define qmake configuration on wandboard. I want to set up crosscompiler in Qt creater which can compile & gives suitable output file for Wandboard.

    I tried to go thru the link "http://wiki.wandboard.org/index.php/Setup_QT_creator_for_developing_QT_apps_on_wandboard". but i am not understanding the part "Export the qmake variables to QT Creator 3.0" that how the qmake configuration is set for Wandboard & how the path "{Yocto directory}/build/tmp/work/cortexa9hf-vfp-neon-mx6-poky-linux-gnueabi/qtbase/5.1.1- r0/build/config.summary" will created.

    Can someone suggest the steps to set up Qt5 for Wandboard in detail?

    Regards,
    Mayur Gaikwad



  • Dear All,

    Please reply some one as early as possible.


  • Moderators

    Have you compiled Qt on this board prior to setting up Qt Creator ?
    After configuring and compiling Qt you will get config.summary in that path.
    And as per the link that you posted you have to add those qmake varaibles in qtcreator.sh

    I can't give a 100% solution on this, since i have not compiled Qt on this board.



  • Hi,

    First of all thank you for replying on my query.

    Actually I haven't compiled Qt for this board. I want to compile on this board & for that I tried to configure Qt5 by setting the compilers & debuggers as arm-linux-gnueabihf-g++ & arm-linux-gnueabihf-gdb respectively. But I am not getting how to set Qt Version, Kits & Devices for the same.

    So to know that I went through the *"setup_QT_creator_for_developing_QT_apps_on_wandboard" *but I am not understanding some part of it.

    can you please tell me how to configure Qt & how to set Qt Version, Kits, Devices etc for Wandboard?

    Thanks


  • Moderators

    Could you try this "Cross_compile_Qt5":http://wiki.wandboard.org/index.php/Building_Qt5_using_yocto_on_Wandboard#Cross_compile_Qt5 ?

    Look out for
    @
    ./configure -v -opensource -confirm-license -device imx6 ...
    @

    which probably helps in configuring Qt as long as the requirements are satisfied.



  • Yes I went through the mentioned link but I am not getting it since it is for Yocto & I am doing in Ubuntu.

    I used Linaro Toolchain for crosscompiling.
    I tried using this command :

    ./configure -opensource -confirm-license -no-pch -no-xcb -no-opengl -opengl es2 -make libs -device-option CROSS_COMPILE=/home/msil/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/bin/arm-linux-gnueabihf- -device linux-imx6-g++ -sysroot /media/rootfs -no-gcc-sysroot -prefix /Qt5.3.1

    but its giving error as

    *Running configuration tests...
    Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
    Note: PKG_CONFIG_SYSROOT_DIR automatically set to /media/msil/rootfs

    Could not determine the target architecture!
    Turn on verbose messaging (-v) to see the final report.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/msil/Qt5.3.1/5.3/Src/qtbase/mkspecs/devices/linux-imx6-g++

    After that i couldn't resolve this issue.

    Please clear me it any thing is missing.


  • Moderators

    It seems you don't have the OpenGL,
    Since ubuntu try
    @
    sudo apt-get install libgles2-mesa-dev
    @

    and then again configure.



  • After using -v as you suggested like,

    sudo ./configure -v -opensource -confirm-license -no-pch -no-xcb -no-opengl -opengl es2 -make libs -device-option CROSS_COMPILE=/home/msil/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/bin/arm-linux-gnueabihf- -device linux-imx6-g++ -sysroot /media/msil/rootfs -no-gcc-sysroot -prefix /Qt5.3.1

    its giving me an error as,

    *opengles2.cpp:45:25: fatal error: GLES2/gl2.h: No such file or directory
    #include <GLES2/gl2.h>
    ^
    compilation terminated.
    make: *** [opengles2.o] Error 1
    OpenGL ES 2.x disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/msil/Qt5.3.1/5.3/Src/qtbase/mkspecs/devices/linux-imx6-g++.

    The "compilation terminated" gets occures for multiple #include files like,
    #include <pulse/pulseaudio.h>, #include <unicode/utypes.h>, #include <glib.h>, #include <dbus/dbus.h>

    And, other errors are,
    make: *** [gnu-libiconv.o] Error 1
    GNU libiconv disabled.
    , make: *** [gnu-libiconv.o] Error 1
    SUN libiconv disabled.,
    make: *** [iconv] Error 1
    POSIX iconv disabled.,
    make: *** [cups.o] Error 1
    Cups disabled.

    etc.



  • I aun this command & it gives me the o/p as,

    msil@msil-ThinkCentre-Edge71:~/Qt5.3.1/5.3/Src$ sudo apt-get install libgles2-mesa-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libgles2-mesa-dev is already the newest version.
    The following packages were automatically installed and are no longer required:
    libbonobo2-0 libbonobo2-common libbonoboui2-0 libbonoboui2-common
    libgconf2-4 libgnome2-0 libgnome2-bin libgnome2-common libgnomecanvas2-0
    libgnomecanvas2-common libgnomeui-0 libgnomeui-common libgnomevfs2-0
    libgnomevfs2-common libidl-common libidl0 liborbit-2-0 liborbit2
    linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic
    linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.



  • Still I got the same error as,

    #include <GLES2/gl2.h>
    ^
    compilation terminated.
    make: *** [opengles2.o] Error 1
    OpenGL ES 2.x disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/msil/Qt5.3.1/5.3/Src/qtbase/mkspecs/devices/linux-imx6-g++.


  • Moderators

    Just run a find command on your system and check where GLES2/gl2.h header file is present.



  • Its giving me response as,

    msil@msil-ThinkCentre-Edge71:~/Qt5.3.1/5.3/Src$ find GLES2/gl2.h
    find: `GLES2/gl2.h': No such file or directory

    Not only this reply its giving same reply to all the include files as

    find: unicode/utypes.h': No such file or directory find:pulse/pulseaudio.h': No such file or directory
    find: glib.h': No such file or directory find:dbus/dbus.h': No such file or directory


  • Moderators

    No not like that, you need to learn how to use find on linux.
    If you have locate command, run updatedb and then run command "locate gl2.h"
    Once you get the location of that header file and its corresponding library set those to variables QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in /home/msil/Qt5.3.1/5.3/Src/qtbase/mkspecs/devices/linux-imx6-g++



  • Now I got the respose as

    msil@msil-ThinkCentre-Edge71:~$ locate gl2.h
    /home/msil/Qt5.3.1/5.3/Src/qtbase/include/QtANGLE/GLES2/gl2.h
    /home/msil/Qt5.3.1/5.3/Src/qtbase/mkspecs/common/ios/GLES2/gl2.h
    /home/msil/Qt5.3.1/5.3/Src/qtbase/src/3rdparty/angle/include/GLES2/gl2.h
    /home/msil/Qt5.3.1/5.3/Src/qtwebkit/Source/ThirdParty/ANGLE/include/GLES2/gl2.h
    /home/msil/Qt5.3.1/5.3/gcc/mkspecs/common/ios/GLES2/gl2.h
    /home/msil/qt5/qtbase/mkspecs/common/ios/GLES2/gl2.h
    /home/msil/qt5/qtbase/src/3rdparty/angle/include/GLES2/gl2.h
    /usr/include/GLES2/gl2.h

    Now can you plz tell me which one of these paths i need to take..


  • Moderators

    Probably the last one and set it to QMAKE_INCDIR_OPENGL_ES2 also search for something like libGLESv2.so and set the path to QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 to may be -lGLESv2



  • For -lGLESv2 its giving response as ,

    msil@msil-ThinkCentre-Edge71:~$ locate -lGLESv2 --limit
    locate: invalid value `GLESv2' of --limit

    plz clear if i am wrong while passing command.
    rest one is woking.

    Can you plz tell me in which file i find the variables QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2?

    Is it inside the file named "qmake.conf"?

    I am having two qmake.conf files on location..
    a) /home/msil/Qt5.3.1/5.3/gcc/mkspecs/linux-arm-gnueabi-g++
    b) /home/msil/Qt5.3.1/5.3/Src/qtbase/mkspecs/linux-arm-gnueabi-g++

    Which location file I have to modify?


  • Moderators

    No, -lGLESv2 is the library that you have to pass to QMAKE_LIBS_OPENGL_ES2 so that compiler understands that it has to compile the code against this library. Don't search it. Try passing that one as it is to QMAKE_LIBS_OPENGL_ES2.

    See if you go to last posts of yours in this thread, you will see the below statements

    bq. OpenGL ES 2.x disabled.
    The OpenGL ES 2.0 functionality test failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in /home/msil/Qt5.3.1/5.3/Src/qtbase/mkspecs/devices/linux-imx6-g++.

    So the second path.



  • You are right.

    I did the same. Let I am explaining it with steps.

    step1: Go to the path & edit qmake.conf file & save it.

    msil@msil-ThinkCentre-Edge71:~/Qt5.3.1/5.3/Src/qtbase/mkspecs/devices/linux-imx6-g++$ nano qmake.conf

    Please find the code inside qmake file.

    @

    qmake configuration for the Freescale iMX6 boards (single, dual and quad)

    This mkspec is based and tested on the ltib-source-release 3.0.15

    Building ltib including glib, gpu-drivers and what ever you want to use (e.g. dbus or fontconfig)

    This mkspec is tested with a framebuffer (eglfs) configuration (not testes with X11)

    A typical configure line looks like:

    /home/tsenyk/qt5/qt5/configure -opensource -confirm-license -make libs -device imx6 \

    -device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- \

    -sysroot <path-to-your-ltib-install>/rootfs -no-gcc-sysroot \

    -prefix /usr/local/Qt-5.0.0/Qt5-imx6-1

    NOTE: currently ltib doesn't produce a proper staging/sysroot-filessystem.

    If gcc's --sysroot is used, the toolchain doesn't find basic binaries (e.g. crt1.o),

    therefore you have to pass -no-gcc-sysroot to configure if you pass -sysroot to configure!

    include(../common/linux_device_pre.conf)

    EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_imx6.cpp

    *QMAKE_INCDIR_OPENGL += /home/msil/Qt5.3.1/5.3/Src/qtwebkit/Source/ThirdParty/ANGLE/include/GLES2/gl2.h
    QMAKE_LIBDIR_OPENGL += /usr/lib/i386-linux-gnu/libGLESv2.so

    QMAKE_LIBS_EGL += -lEGL
    QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
    QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL

    QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib

    IMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
    IMX6_CFLAGS_RELEASE = -O2 $$IMX6_CFLAGS
    QMAKE_CFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
    QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
    QMAKE_CFLAGS_DEBUG += $$IMX6_CFLAGS
    QMAKE_CXXFLAGS_DEBUG += $$IMX6_CFLAGS

    include(../common/linux_arm_device_post.conf)

    load(qt_config) @

    step2: Go to the path & enter the Command

    msil@msil-ThinkCentre-Edge71:~/Qt5.3.1/5.3/Src/qtbase$ sudo ./configure -v -opensource -confirm-license -no-pch -no-xcb -no-opengl -opengl es2 -make libs -device-option CROSS_COMPILE=/home/msil/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/bin/arm-linux-gnueabihf- -device linux-imx6-g++ -sysroot /media/msil/rootfs -no-gcc-sysroot -prefix /Qt5.3.1
    [sudo] password for msil:

    But after this again the same error occurs.

    I am not getting what is wrong in this.


  • Moderators

    Where's QMAKE_INCDIR_OPENGL_ES2 ?
    Set path until the folder and donot include header filename.

    Where's QMAKE_LIBDIR_OPENGL_ES2 ?
    Set path until the folder and donot include library filename.



  • You mean to say,
    I have to include only the path & not the include files.

    As per my understanding this must be,

    QMAKE_INCDIR_OPENGL += /home/msil/Qt5.3.1/5.3/Src/qtwebkit/Source/ThirdParty/ANGLE/include/GLES2

    QMAKE_LIBDIR_OPENGL += /usr/lib/i386-linux-gnu

    Is it OK?

    And what about QMAKE_LIBS_OPENGL_ES2 ?

    Is it OK with QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL


  • Moderators

    Yes the path's are correct but not the variables. See there's _ES2 appended to each variable.



  • Ohhh, sorry

    QMAKE_INCDIR_OPENGL_ES2 += /home/msil/Qt5.3.1/5.3/Src/qtwebkit/Source/ThirdParty/ANGLE/include/GLES2

    QMAKE_LIBDIR_OPENGL_ES2 += /usr/lib/i386-linux-gnu

    OK now?

    And what about rest code in qmake.conf, is it ok?


  • Moderators

    Sorry, set QMAKE_INCDIR_OPENGL_ES2 to /usr/include/GLES2/



  • I set

    QMAKE_INCDIR_OPENGL_ES2 = /usr/include/GLES2/

    & rest code is as it is.
    But after giving ./configure command problem is still as it is.


  • Moderators

    But all the Paths are now correctly set ? Can you post the new qmake.conf ?



  • Please see the new qmake.conf file

    @#

    qmake configuration for the Freescale iMX6 boards (single, dual and quad)

    This mkspec is based and tested on the ltib-source-release 3.0.15

    Building ltib including glib, gpu-drivers and what ever you want to use (e.g. dbus or fontconfig)

    This mkspec is tested with a framebuffer (eglfs) configuration (not testes with X11)

    A typical configure line looks like:

    /home/tsenyk/qt5/qt5/configure -opensource -confirm-license -make libs -device imx6 \

    -device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- \

    -sysroot <path-to-your-ltib-install>/rootfs -no-gcc-sysroot \

    -prefix /usr/local/Qt-5.0.0/Qt5-imx6-1

    NOTE: currently ltib doesn't produce a proper staging/sysroot-filessystem.

    If gcc's --sysroot is used, the toolchain doesn't find basic binaries (e.g. crt1.o),

    therefore you have to pass -no-gcc-sysroot to configure if you pass -sysroot to configure!

    include(../common/linux_device_pre.conf)

    EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_imx6.cpp

    QMAKE_INCDIR_OPENGL_ES2 += /usr/include/GLES2/
    QMAKE_LIBDIR_OPENGL_ES2 += /usr/lib/i386-linux-gnu/

    QMAKE_LIBS_EGL += -lEGL
    QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
    QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL

    QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib

    IMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
    IMX6_CFLAGS_RELEASE = -O2 $$IMX6_CFLAGS
    QMAKE_CFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
    QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
    QMAKE_CFLAGS_DEBUG += $$IMX6_CFLAGS
    QMAKE_CXXFLAGS_DEBUG += $$IMX6_CFLAGS

    include(../common/linux_arm_device_post.conf)

    load(qt_config)@


  • Moderators

    Can you make sure those libraries are for ARM ? You can use file command for that.
    eg.
    @
    file /usr/lib/i386-linux-gnu/libGLESv2.so
    @

    and post the output here



  • No these files are not for ARM, its for Intel, see the o/p

    msil@msil-ThinkCentre-Edge71:~/Qt5.3.1/5.3/Src/qtbase$ file /usr/lib/i386-linux-gnu/libGLESv2.so
    /usr/lib/i386-linux-gnu/libGLESv2.so: symbolic link to `mesa-egl/libGLESv2.so'

    msil@msil-ThinkCentre-Edge71:~/Qt5.3.1/5.3/Src/qtbase$ file /usr/lib/i386-linux-gnu/mesa-egl/libGLESv2.so
    /usr/lib/i386-linux-gnu/mesa-egl/libGLESv2.so: symbolic link to `libGLESv2.so.2.0.0'

    msil@msil-ThinkCentre-Edge71:~/Qt5.3.1/5.3/Src/qtbase$ file /usr/lib/i386-linux-gnu/mesa-egl/libGLESv2.so.2.0.0
    /usr/lib/i386-linux-gnu/mesa-egl/libGLESv2.so.2.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=9a43029fd41b7b30967de0b2c1b43bcdd5316606, stripped

    How to get corresponding ARM files?


  • Moderators

    Can you again locate libGLESv2.so and check if there's other libraries and then running file command for each of them ?
    But since you have apt-get install'd the drivers it should have downloaded the ARM versions of those libraries instead of Intel.
    Is wandboard arm based for sure ?



  • When I give locate libGLESv2.so then only a single file found which is for Intel version. No other file found.

    i am not getting what you asked about Wandboard, can you plz elaborate?


  • Moderators

    I said that since you have installed opengl es libraries using apt-get i think it should have downloaded arm compatible libraries and not intel
    Can you
    @
    apt-get install libgles1-mesa libgles1-mesa-dev
    apt-get install freeglut3 freeglut3-dev
    @

    and then see if you get arm based libraries



  • Still I am not getting the libGLESv2.so file other than previous.

    Can you tell from scratch how to setup Qt for my wandboard application?

    I think there is some wrong at my end while doing all this thing.



  • can I explain you in brief how i am started & how i reached at this stage in my project?

    this will help you to know if i was wrong at some point during this progress.


  • Moderators

    First we need to configure Qt before compiling, so during configuration process we get this OpenGL ES error, we have installed the libraries, found the paths of it's related header files and libraries and saved it to qmake.conf using those variables.
    The problem i guess here is those libraries are Intel and not ARM and we need ARM compatible libraries since board is ARM based.

    One way would be try repeating the whole process again to errors if any.

    Well i think best would be to ask on their "forums":http://www.wandboard.org/index.php/forums, someone definitel must have done it for ubuntu and not yocto..



  • Ok ,
    Surely I will put the same problem at Wandboard forum. Lets see what is reply from that forum.

    I will get back to you once they reply.

    Thanks.


  • Moderators

    Hi,

    Just backtracked, since you are cross compiling, need to set the paths of OpenGL ES libs and headers to that of your toolchain. You toolchain must have those header files and the library too.



  • As you said, can you tell me what are the OpenGL ES libraries & headers for Linaro toolchain (gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux) which i am using.

    Also plz tell me where to set the paths of those files.


  • Moderators

    The same that we searched earlier:
    header - GLES2/gl2.h i.e GLES2/*
    library - libGLESv2.so

    It must be in the toolchain.



  • Hi,

    I have checked the header files & library files within the toolchain but its not there.

    You can check it by downloading the toolchain from below link.

    "https://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz":http://


  • Moderators

    Another possibility of those OpenGL libraries would be in the Ubuntu image that you have downloaded. Can you search for those in the Ubuntu that you have flashed on the board ?


Log in to reply
 

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