Qt5 compilation for iMX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Qt5 compilation for iMX6

5,221 Views
xavierj
Contributor I

I am trying to compile Qt5.8 for the iMX6 processor board by following the build instructions from the below link:

Building QT for i.MX6 

As per the instructions, I am able to build and get the libraries and qmake. But, I have the following queries:

1. There are two configure files, one in qtbase and one outside where all the qt modules resides. And as the instruction points out to use qtbase, what is the role of the one outside the qt modules. The reason why I am asking is that when I run that configure it throws the below error:

ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.

ERROR: Feature 'eglfs' was enabled, but the pre-condition 'features.egl' failed.

ERROR: The OpenGL functionality tests 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 the mkspec for your platform.

And also does not have the gstreamer module and the eglfs module enabled:

Qt Multimedia:
  ALSA ................................... yes
  GStreamer 1.0 .......................... no
  GStreamer 0.10 ......................... no

QPA backends:
  DirectFB ............................... no
  EGLFS .................................. no
  LinuxFB ................................ yes
  Mir client ............................. no
  X11:
    Using system provided XCB libraries .. yes
    EGL on X11 ........................... no
    Xinput2 .............................. yes
    XCB XKB .............................. yes
    XLib ................................. yes
    Xrender .............................. yes
    XCB render ........................... yes
    XCB GLX .............................. yes
    XCB Xlib ............................. yes
    Using system-provided xkbcommon ...... yes

This is my configure command:

./configure -v -opensource -release -confirm-license -no-pch -eglfs -opengl es2 -c++std c++14 -qpa eglfs -make libs -device imx6 -device-option CROSS_COMPILE=/home/Toolchain/gcc-linaro-5.4.1-2017.05-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /home/Rootfs/yocto-gold-qt5.8 -hostprefix /opt/qt5 -prefix /opt/qt5 -extprefix /opt/qt5 -pkg-config

Which is the file I need to edit in order to enable/disable these modules?

After googling the error, it was said that I need to provide the target rootfs path for OpenGL, which can be found below, which had no impact.

include(../common/linux_device_pre.conf)


#QMAKE_INCDIR = /home/Rootfs/yocto-rootfs-qt5/usr/include/
#QMAKE_LIBDIR = /home/Rootfs/yocto-rootfs-qt5/usr/lib

#QMAKE_INCDIR_OPENGL =/home/Rootfs/yocto-rootfs-qt5/usr/include/GL
#QMAKE_LIBDIR_OPENGL=/home/Rootfs/yocto-rootfs-qt5/usr/lib
#QMAKE_LIBS_OPENGL=/home/Rootfs/yocto-rootfs-qt5/usr/lib

#QMAKE_INCDIR_OPENGL_ES2 =/home/Rootfs/yocto-rootfs-qt5/usr/include/GLES2
#QMAKE_LIBDIR_OPENGL_ES2=/home/Rootfs/yocto-rootfs-qt5/usr/lib
#QMAKE_LIBS_OPENGL_ES2=/home/Rootfs/yocto-rootfs-qt5/usr/lib

QT_SYSROOT = /home/Rootfs/yocto-rootfs-qt5

QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/usr/lib
QMAKE_LIBDIR_EGL        = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR_OPENVG     = $$QMAKE_LIBDIR_OPENGL_ES2

QMAKE_INCDIR_EGL        = $$[QT_SYSROOT]/usr/include \
                          #$$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads \
                          #$$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
QMAKE_INCDIR_OPENVG     = $${QMAKE_INCDIR_EGL}

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

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

IMX6_CFLAGS             = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
QMAKE_CFLAGS           += $$IMX6_CFLAGS
QMAKE_CXXFLAGS         += $$IMX6_CFLAGS


DISTRO_OPTS += hard-float

# Preferred eglfs backend
EGLFS_DEVICE_INTEGRATION = eglfs_viv

include(../common/linux_arm_device_post.conf)

load(qt_config)

I tried using the paths directly as well as using as QT_SYSROOT by providing path on my own as well as without adding any path to QT_SYSROOT.

Because of the absence of eglfs I am unable to run my application without the Xsession and my Video QML element does not work either saying

"defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
qml: HiThe QMediaPlayer object does not have a valid service"

Kindly, help me out in this issue.

Labels (3)
Tags (2)
0 Kudos
0 Replies