Problem to get OpenGL support with Qt 5.3.2 embedded

  • Hi,

    I'm having some problems with Qt and OpenGL.
    I am not able to compile Qt 5.3.2 with the OpenGL support flag. I'm having a "All the OpenGL functionality tests failed!".

    I'm on a Virtual Machine with Ubuntu 14.04 LTS 64bit.

    Here is my configure command:
    @./configure -prefix /usr/local/qt-embedded-5.3.2 -xplatform linux-arm-gnueabi-g++ -opensource -device-option CROSS_COMPILE=/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/bin/arm-linux-gnueabihf-gcc -no-largefile -v -opengl -confirm-license@

    And here the errors related to OpenGL:
    @OpenGL auto-detection... ()
    arm-linux-gnueabihf-g++ -c -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-arm-gnueabi-g++ -I. -I/usr/include/GL -o opengldesktop.o opengldesktop.cpp
    opengldesktop.cpp:45:19: fatal error: GL/gl.h: No such file or directory
    #include <GL/gl.h>
    compilation terminated.
    make: *** [opengldesktop.o] Error 1
    OpenGL disabled.
    OpenGL ES 2.x auto-detection... ()
    arm-linux-gnueabihf-g++ -c -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-arm-gnueabi-g++ -I. -o opengles2.o opengles2.cpp
    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.
    All the OpenGL functionality tests failed!
    You might need to modify the include and library search paths by editing

    Here my qmake.config file:

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

    CONFIG += incremental


    #include openGL libraries
    QMAKE_INCDIR_OPENGL = /usr/arm-linux-gnueabihf/include/GL
    QMAKE_LIBDIR_OPENGL = /usr/arm-linux-gnueabihf/lib
    QMAKE_LIBDIR_X11 = /usr/arm-linux-gnueabihf/lib

    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

    Inside my /usr/arm-linux-gnueabihf/include/GL, I have the gl.h file.

    I tried without the flag -opengl but Qt does not recognize the QT += opengl getting this error "Project ERROR: Unknown module(s) in QT: opengl" on Qt Creator.

    I also tried using :
    @QMAKE_INCDIR_OPENGL = /usr/include/GL
    QMAKE_LIBDIR_OPENGL = /usr/lib
    QMAKE_LIBS_OPENGL = /usr/lib@

    What am I doing wrong ? What am I missing ?
    I tried a lot of things but I never get it work and I was not able to find an answer to this kind of question on internet.

    Thank you for your help.


  • Did you try to add the path inside the .pro file on the follwoing way?

    INCLUDEPATH += /usr/arm-linux-gnueabihf/include/GL

  • [quote author="kuschky" date="1418995567"]Did you try to add the path inside the .pro file on the follwoing way?

    INCLUDEPATH += /usr/arm-linux-gnueabihf/include/GL


    Thank you for your help! I added this INCLUDEPATH to my and it is compiling now.
    I needed to copy some libraries from my target system into my host system but your solution is working!

    Thank you a lot!


  • @MorganeJ
    You have this in your Qmake.conf file:

    QMAKE_INCDIR_OPENGL = /usr/arm-linux-gnueabihf/include/GL
    QMAKE_LIBDIR_OPENGL = /usr/arm-linux-gnueabihf/lib
    QMAKE_LIBDIR_X11 = /usr/arm-linux-gnueabihf/lib

    Where did you get these files? What are they? I am having some issues compiling myself, and dont really understand that part.

  • @MorganeJ Hi, I wonder how you can cross compile qt5 using a desktop-opengl? Should it be opengl es2? Cound the opengl edition you compiled work well on your embedded board? Thanks in advance!

Log in to reply

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