Undefined Reference to 'qt_version_tag'

Hello,

We are trying to work through a compile error that we receive when attempting to build any software project setup using Qt Creator.

We have used the Toradex detailed documentation available on developer.toradex.com to build everything necessary to generate an embedded Linux OS system image installer from the source files that Toradex provides on their Git server located at: git.toradex.com. We have also successfully downloaded the image that we built to the Colibri i.MX7D board and it works great. The image is copied from our SD Card to NAND and it loads from NAND just fine. To do this we used the following document provided on developer.toradex.com:

http://developer.toradex.com/knowledge-base/board-support-package/openembedded-(core)

We have also used the following document located on developer.toradex.com to setup Qt Creator to cross compile for our embedded Linux image:

http://developer.toradex.com/knowledge-base/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux

After following this document we have attempted to build a number of the example projects that Qt Creator provides for a Generic Linux Device. On some of the user interface example projects we see errors regarding openGL when attempting a build. I thought I remember reading somewhere that the image Toradex supplies provides OpenGL support. Is this an additional component that we need to build into the SDK used by Qt Creator that is not mentioned in the Qt Creator cross-compile document above?

We also notice that when building some of the non user interface based projects that there are warnings which appear related to incompatible libraries. After searching online we discovered that this is not likely an issue that would prevent us from running applications on the embedded Linux installed on our Colibri i.MX7D board since the correct libraries appear to be found as there are no errors related to this. We would like to figure out how to resolve these warnings at some point.

We do have one error though that, so far, we have not been able to figure out. The error is: “undefined reference to ‘qt_version_tag’”. We have researched this online and there are some forums that mention changes which can be made to a CMakeLists.txt file. Unfortunately, there are hundreds of these files throughout folders in our OpenEmbedded build of the embedded Linux OS. This error message isn’t specific enough to determine where the problem is located. Does anyone know what the problem might be?

I have attached some screen images of the steps we’ve taken to setup the Qt Creator project that we are building. There is also a screen image of the warnings and errors that I’m referring to above. We are developing a Qt Quick Application as a test.

We did try and setup the Qt Creator environment using the document, which talks about using Qt Creator 3.0. The problem with this is that we cannot establish a connection to the Colibri i.MX7D board using our private network through Qt Creator 3.0. In order to make that work we had to use our already installed Qt Creator 4.0.2.

We do have a toolchain installed on our host Ubuntu Linux OS, for another one of our products that also runs a, different, version of embedded Linux. This toolchain is also available in Qt Creator 4.0.2. We don’t know if it’s possible that somewhere there is a problem with improper referencing between the toolchains installed and this is causing the problem, but so far we have been unable to resolve this issue and successfully build an application for our embedded Linux.

Also, when we follow these directions in the cross-compile document:

Note: With Qt 5.7 from OpenEmbedded Morty release (BSP version 2.7 Beta1 and later) require Qt mkspec to be set as follows /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ Note: When using Qt Embedded, you may want to switch to the “Run” configuration and add the argument “-qws” to the binary as standalone (instead using the Qt for Embedded Linux server).

The Tools->Options window displays an error symbol next to our kit and we cannot begin a compilation of our project.

Any help that anyone can provide to resolve this issue so that we can start successfully building applications would be greatly appreciated.

Thank You

link text

i.MX 7 and OpenGL

The i.MX 7 SoC does not have a GPU and hence no hardware OpenGL support. It is possible to use software emulated OpenGL, although this will be slow and is not recommended. See also the discussion in this thread.

Qt Creator

Qt Creator 4.0.2 should work just fine, I don’t think that this is a version issue. Where do you get the “undefined reference to ‘qt_version_tag’” error? On the target? Can you post the complete output?

Not sure why the Build & Run configuration is red. Did you source the environment script in the same shell where you start Qt Creator as described here?

Hello Stefan.tx,

Thanks for responding so quickly to my question. It is greatly apprecieated. Also, thank you for the information on OpenGL that you provided.

The “undefined reference to ‘qt_version_tag’” comes from the Issues tab in Qt Creator after building the code. Here is the complete compilation output that I see in the “Compile Output” tab in Qt Creator 4.0.2:

17:25:21: Running steps for project Hello_World3…
17:25:21: Starting: “/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/qt5/qmake” /home/carloval/Development/New_Products/Hello_World3/Hello_World3.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
Info: creating stash file /home/carloval/Development/New_Products/build-Hello_World3-Toradex_Qt_Embedded-Debug/.qmake.stash
17:25:21: The process “/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/qt5/qmake” exited normally.
17:25:21: Starting: “/usr/bin/make”
g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I…/Hello_World3 -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5 -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtQuick -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtQml -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtNetwork -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtCore -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++ -o main.o …/Hello_World3/main.cpp
/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/qt5/rcc -name qml …/Hello_World3/qml.qrc -o qrc_qml.cpp
g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I…/Hello_World3 -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5 -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtQuick -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtQml -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtNetwork -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtCore -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++ -o qrc_qml.o qrc_qml.cpp
g++ -o Hello_World3 main.o qrc_qml.o -L/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib -lQt5Quick -L/home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lpthread
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Quick.so when searching for -lQt5Quick
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libQt5Quick.so when searching for -lQt5Quick
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Gui.so when searching for -lQt5Gui
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libQt5Gui.so when searching for -lQt5Gui
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Qml.so when searching for -lQt5Qml
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libQt5Qml.so when searching for -lQt5Qml
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Network.so when searching for -lQt5Network
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libQt5Network.so when searching for -lQt5Network
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libQt5Core.so when searching for -lQt5Core
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libQt5Core.so when searching for -lQt5Core
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libGLESv2.so when searching for -lGLESv2
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libGLESv2.so when searching for -lGLESv2
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libpthread.a when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /home/carloval/work/Colibri/IMX7/openembedded/oe-core/build/tmp-glibc/sysroots/colibri-imx7/usr/lib/libc.a when searching for -lc
main.o:(.qtversion[qt_version_tag]+0x0): undefined reference to `qt_version_tag’
collect2: error: ld returned 1 exit status
make: *** [Hello_World3] Error 1
17:25:24: The process “/usr/bin/make” exited with code 2.
Error while building/deploying project Hello_World3 (kit: Toradex (Qt Embedded))
When executing step “Make”
17:25:24: Elapsed time: 00:03.

I did not source the environment script when using Qt Creator 4.0.2 so I followed the link that you gave to do so, but the results are still the same. The Compile Output provided above was generated after sourcing the environment script according to the document and building the project. I do see some further output in the terminal window where Qt Creator 4.0.2 was launched:

carloval@ubuntu:~$ . /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi
carloval@ubuntu:~$ echo $OE_QMAKE_CXX
arm-angstrom-linux-gnueabi-g++ -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi
carloval@ubuntu:~$ /home/carloval/Qt5.7.0/Tools/QtCreator/bin/qtcreator
QXcbConnection: XCB error: 3 (BadWindow), sequence: 4107, resource id: 12962015, major code: 40 (TranslateCoords), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 4704, resource id: 12976228, major code: 40 (TranslateCoords), minor code: 0
“Error in " .qtQuickVersion”: SyntaxError: Syntax error"
“Error in " .qtQuickVersion”: SyntaxError: Syntax error"
Info: creating stash file /home/carloval/Development/New_Products/build-Hello_World3-Toradex_Qt_Embedded-Debug/.qmake.stash
Could not find absolute location of file "(.qtversion[qt_version_tag]+0x0)"

The two QxcbConnection errors came from setting the incorrect SSH port when testing my connection to the device using Tools->Options. I corrected the error and successfully established a connection. The other errors provide more information than I had before, but they aren’t descriptive enough for me to figure out what is going on. This is my first project ever using embedded Linux so I’m not to familiar enough with the tools to know what to do about the errors that I’m seeing.

Also, after sourcing the environment script according to the document I tried the following again according to the same document that you provided:

Note: With Qt 5.7 from OpenEmbedded Morty release (BSP version 2.7 Beta1 and later) require Qt mkspec to be set as follows
/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++
Note: When using Qt Embedded, you may want to switch to the “Run” configuration and add the argument “-qws” to the binary as standalone (instead using the Qt for Embedded Linux server).

When I do this I still get the red circle with the exclamation mark next to the toolchain in Tools->Options like something is wrong, but there’s no additional information to help me figure out what the problem might be.

Thank You

I see the line:

Info: creating stash file /home/carloval/Development/New_Products/build-Hello_World3-Toradex_Qt_Embedded-Debug/.qmake.stash

that is part of the output that I provided below. I was able to open the .qmake.stash file and view it’s contents as shown below:

QMAKE_DEFAULT_INCDIRS =
/usr/include/c++/4.8
/usr/include/x86_64-linux-gnu/c++/4.8
/usr/include/c++/4.8/backward
/usr/lib/gcc/x86_64-linux-gnu/4.8/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
QMAKE_DEFAULT_LIBDIRS =
/usr/lib/gcc/x86_64-linux-gnu/4.8
/usr/lib/x86_64-linux-gnu
/usr/lib
/lib/x86_64-linux-gnu
/lib

These are paths for qmake, but I’m not sure that’s helpful for resolving the issue that I’m having.

Instead of the absolute path just enter linux-oe-g++ to the Qt mkspec configuration field and the red circle and the undefined reference to ‘qt_version_tag’ should be gone.

I can’t reproduce any of the errors you see. I used a fresh oecore setup and build the SDK using

MACHINE=colibri-imx7 bitbake meta-toolchain-qt5

and then installing it in /usr/local/oecore-x86_64.

echo $OE_QMAKE_CXX
arm-angstrom-linux-gnueabi-g++ -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi

Starting QtCreator (my QtCreator version is at distribution default 4.2.1) from the terminal where the script is sourced and trying to build a simple analog clock example gave me this error

14:36:30: Starting: "/usr/bin/make" 
arm-angstrom-linux-gnueabi-g++  -march=armv7-a -mthumb -mfpu=neon  -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -c -pipe -O2 -pipe -g -feliminate-unused-debug-types -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../AnalogClock -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5 -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtWidgets -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtCore -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -o analogclock.o ../AnalogClock/analogclock.cpp
In file included from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui/qopenglcontext.h:60:0,
                 from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui/QtGui:32,
                 from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtWidgets/QtWidgetsDepends:4,
                 from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtWidgets/QtWidgets:3,
                 from ../AnalogClock/analogclock.cpp:41:
/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui/qopengl.h:99:27: fatal error: GLES3/gl31.h: No such file or directory
compilation terminated.
make: *** [Makefile:1106: analogclock.o] Error 1
14:36:30: The process "/usr/bin/make" exited with code 2.

This error seems to occur only for iMX7. A workaround for now is to build an SDK for apalis-imx6 and use that which resolves the above issue and I can build the analog clock example.

14:55:52: Starting: "/usr/bin/make" 
arm-angstrom-linux-gnueabi-g++  -march=armv7-a -mthumb -mfpu=neon  -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -c -pipe -O2 -pipe -g -feliminate-unused-debug-types -g -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../AnalogClock -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5 -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtWidgets -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtCore -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -o analogclock.o ../AnalogClock/analogclock.cpp
arm-angstrom-linux-gnueabi-g++  -march=armv7-a -mthumb -mfpu=neon  -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -c -pipe -O2 -pipe -g -feliminate-unused-debug-types -g -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../AnalogClock -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5 -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtWidgets -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtCore -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -o main.o ../AnalogClock/main.cpp
/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/qt5/moc -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -I/home/sanchayan/Toradex/QtProjects/AnalogClock -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5 -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtWidgets -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtCore -I. -I/usr/include -I/usr/local/include ../AnalogClock/analogclock.h -o moc_analogclock.cpp
arm-angstrom-linux-gnueabi-g++  -march=armv7-a -mthumb -mfpu=neon  -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -c -pipe -O2 -pipe -g -feliminate-unused-debug-types -g -DLINUX=1 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../AnalogClock -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5 -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtWidgets -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtGui -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/qt5/QtCore -I. -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -o moc_analogclock.o moc_analogclock.cpp
arm-angstrom-linux-gnueabi-g++  -march=armv7-a -mthumb -mfpu=neon  -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o analogclock analogclock.o main.o moc_analogclock.o   -L/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lEGL -lGAL -lpthread 
14:56:00: The process "/usr/bin/make" exited normally.
14:56:00: Elapsed time: 00:09.

The Qt image can be build for iMX7 as follows

MACHINE=colibri-imx7 bitbake angstrom-qt5-x11-image

Can you check the settings again as per here? Do you set Qt mkspec correctly?

Dude! marode, you are my hero right now. This exactly what I needed to do to fix our problem. Sorry for the late response on this because I’ve been off working on something else over the last week, but your suggestion fixed the problem and the project is building fine now.

I do have another issue now that you helped me to get past this one. If I need to create a separate thread on the forum for this I will.

Now, the problem is that when I try to run the debugger it looks like it starts, but I see the following information displayed in the Application Output section of Qt Creator:

Debugging starts
Listening on port 10000
Debugging has failed
Debugging has finished

I’ve set a break point in the main function, but it is never hit. Looking at Projects->Run in Qt Creator I see the information Executable on device: /opt/Hellow_World15/bin/Hello_World15

Our device has a display screen so I can navigate to the folder: /opt/Hellow_World15/bin/Hello_World15 and I indeed see that the executable has been downloaded there, so we are able to establish a connection to the device and communicate with it to download the application, but I’m not sure why the debugger cannot seem to establish a connection, or it does not work properly.

We followed the documentation How to set up Qt Creator to cross compile for embedded Linux on Toradex’s developer site and added the Debugger: GDB (Qt Embedded) as specified.

Is there some other step that we need to take to make the debugger work properly?

Thanks again. You’ve been a very big help. :).

Hello stefan.tx,

Thanks for the information you provided. I read through the help that you gave another forum user in the “this thread” link in your response to me. It looks like we have two options based on your response in the other thread:

  1. Do not use Qt Quick 2, just use Qt Widgets.
  2. Use Qt For Device Creation that is a paid version of Qt Creator.

I’m not sure I fully understand the following that you said in the other thread though:

Since Qt 5.7 the Qt Quick 2D Renderer is available under the GPLv3 Open Source License. The OpenEmbedded built Toradex BSP currently does not support Qt 5.7 hence today this option is not supported… (Note also that the terms of GPLv3 typically means that your application has to be open sourced as well).

When I look at the Toradex (Qt Embedded) Kit that is available in Qt Creator which we added by following Toradex’s available online document:

How to set up Qt Creator to cross compile for embedded Linux

I see that this kit is based on Qt 5.7.0 (qt5) when viewing the details in the Qt Creator IDE. It appears that your BSP does support Qt 5.7. Are you saying that the Tordex BSP DOES support Qt 5.7, but it DOES NOT support Qt Quick 2 Render in Qt 5.7? If this is the case what you are saying does make since to me.

In either case I tried creating a Qt Widgets Application in Qt Creator by doing the following:

  1. Selecting File->New File or Project…
  2. From the New File or Project dialog box that appears I selected the Qt Widgets Application
    template. Is this the template that I need to select if we want to create a GUI without using Qt
    Quick 2?

After giving the project a name and continuing the project is created with default files: main.cpp and mainwindow.cpp. The project builds successfully with no errors. Although in the Qt Creator General Messages tab I do see the following lines:

/bin/sh: OE_QMAKE_CXX: command not found
/bin/sh: OE_QMAKE_CXXFLAGS: command not found

Do you know why this is happening?

I any case regardless of the above messages the Compile Output tab in Qt Creator indicates that the build is successful and the executable file is generated successfully. When I deploy the application to the device it works and is placed at the location that I specified in the Qt Creator .pro (project) file.

When I try to run the application on the device by selecting it using the devices display a dialog box appears asking if I would like to execute the file. When I click the Execute button nothing happens. A blank default GUI window does not appear as I would have expected. Do you know what I need to do to make this work? In the file system of Ubuntu Linux where am using Qt Creator to build the application I made sure that the application that I built, and is downloaded to the device, is set as executable. So I should be able to run it on the device.

Also, when attempting to debug the application I see the output, from Qt Creator, that I mentioned in response to marode below:

Debugging starts
Listening on port 10000
Debugging has failed
Debugging has finished

Do you know why this would be happening?

Also, what would you recommend as a way to more rapidly develop a multi window GUI application: Qt5 without Qt Quick 2/QML (just Qt Widgets), or Qt’s paid version of Qt Creator: Qt for Device Creation?

I apologize for the barrage of questions, but I’m just not familiar with embedded Linux development or Qt Creator. My background is in embedded development using both Windows CE and VxWorks so this is an all new environment for me.

Thanks again for all of your help with everything. It is greatly appreciated.

Although in the Qt Creator General Messages tab I do see the following lines:
/bin/sh: OE_QMAKE_CXX: command not found /bin/sh: OE_QMAKE_CXXFLAGS: command not found
Do you know why this is happening?

Do you start QtCreator from the same shell where the environment script was sourced?

[sanchayan@Sanchayan-Arch ~]$ . /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi 
[sanchayan@Sanchayan-Arch ~]$ echo $OE_QMAKE_CXX
arm-angstrom-linux-gnueabi-g++ -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi
[sanchayan@Sanchayan-Arch ~]$ qtcreator &

This is how QtCreator should have been started.

When I try to run the application on the device by selecting it using the devices display a dialog box appears asking if I would like to execute the file. When I click the Execute button nothing happens.

Is your QtCreator really setup correctly for cross compilation? What is the output of “file” command on the executable generated.

file exe_name
exe_name: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.1.10, BuildID[sha1]=596834e137c864480784e43f84f1d7feb332a420, not stripped, with debug_info

Does it show something similar to the above? If you create a Qt Quick 2 project, do you have an image on the module with those Qt libraries deployed?

Do you start QtCreator from the same shell where the environment script was sourced?

[sanchayan@Sanchayan-Arch ~]$ . /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi
[sanchayan@Sanchayan-Arch ~]$ echo $OE_QMAKE_CXX
arm-angstrom-linux-gnueabi-g++ -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi
[sanchayan@Sanchayan-Arch ~]$ qtcreator &

Yes, every time I start Qt Creator I follow the Toradex document: How to set up Qt Creator to cross compile for embedded Linux link text which contains the steps that you provided above. The difference is that you have qtcreator & instead of qtcreator on your last line. Is this a typo or intentional?

Here is my output:

carloval@ubuntu:~$ . /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-
angstrom-linux-gnueabi
carloval@ubuntu:~$ echo $OE_QMAKE_CXX
arm-angstrom-linux-gnueabi-g++ -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi

In either case it does not work. I still see the lines:

/bin/sh: OE_QMAKE_CXX: command not found
/bin/sh: OE_QMAKE_CXXFLAGS: command not found

in the General Messages tab in Qt Creator. I have followed all of the steps in the How to set up Qt Creator to cross compile for embedded Linux to make this work.

Here is my output from running file exe_name as you specified above:

file HelloWorld
HelloWorld: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.1.10, BuildID[sha1]=67c5ad1d89b3786d3976f5517bf9b26a22f341e0, not stripped

It is somewhat different from your output, and I do not see the text with debug_info in my output like I see in your output. I am specifying in Qt Creator to build the executable as debug and it is output to a debug folder.

If you create a Qt Quick 2 project, do you have an image on the module with those Qt libraries deployed?

The link that stefan.tx provided to the another forum thread states the following:

Since Qt 5.7 the Qt Quick 2D Renderer is available under the GPLv3 Open Source License. The OpenEmbedded built Toradex BSP currently does not support Qt 5.7 hence today this option is not supported… (Note also that the terms of GPLv3 typically means that your application has to be open sourced as well).

If this states that the Toradex BSP does not support Qt Quick 2 in Qt 5.7, how am I supposed to create a Qt Quick 2 project and build it?

Thank You

The difference is that you have qtcreator & instead of qtcreator on your last line. Is this a typo or intentional?

The “&” implies that the command will be run in background.

Since Qt 5.7 the Qt Quick 2D Renderer is available under the GPLv3 Open Source License. The OpenEmbedded built Toradex BSP currently does not support Qt 5.7 hence today this option is not supported… (Note also that the terms of GPLv3 typically means that your application has to be open sourced as well).

At least the above is not stated in the article. The forum post you exactly refer to is from October 2016 and is not applicable with regards to Qt version today. The current OpenEmbedded version is based on morty branch which supports Qt 5.7, so Qt 5.7 is definitely supported. The point to note would be below as @stefan stated

The i.MX 7 SoC does not have a GPU and hence no hardware OpenGL support. It is possible to use software emulated OpenGL, although this will be slow and is not recommended.

and from the article

Qt Quick 2.0 which is part of Qt 5 uses a OpenGL based render. Since some of our modules to not support hardware accelerated OpenGL (e.g. NXP/Freescale Vybrid based Colibri VF50/VF61), be prepared for bad performance on those modules.

So you can definitely use Qt 5.7 and Qt Quick 2 on iMX7 with the latest OE build images subject to your performance and licensing requirements.

sanchayan.tx, thanks for your very fast response. It is greatly appreciated. Your latest response has cleared things up for me.

I do have a question from an earlier response that you gave though. I am trying to run the AnalogClock example that you mentioned. You stated that there is an issue with this example when trying to build it for the i.MX7 and your suggestion was to build the SDK for an apalis-imx6. The error you received above during your build was:

fatal error: GLES3/gl31.h: No such file or directory

I see this same error when attempting to build many of the sample projects. You provided the following line to make a Qt Image:

MACHINE=colibri-imx7 bitbake angstrom-qt5-x11-image.bb

Where do I place this line?

I looked through the Toradex documentation:

Build U-Boot and Linux Kernel from Source Code, and
How to set up Qt Creator to cross compile for embedded Linux

but I don’t see a MACHINE= line anywhere? Are you saying that I need to build a new kernel and SDK for an apalis-imx6 or just an SDK?

From the document:

How to set up Qt Creator to cross compile for embedded Linux

should I replace:

bitbake -k meta-toolchain-qt5

with

bitbake -k angstrom-qt5-x11-image.bb

Is this how to build the apalis-imx6 SDK?

Thank You

I updated my original post. There was typo, the command to build a Qt5 X11 image would be

MACHINE=colibri-imx7 bitbake angstrom-qt5-x11-image

OpenEmbedded setup would be required as per this article. Before building the image with the above command, add the following to ~oe-core/build/conf/local.conf

IMAGE_INSTALL_append = "cinematicexperience"

which would then include Qt Quick 2.0 dependencies.

The SDK can be build with

MACHINE=apalis-imx6 bitbake meta-toolchain-qt5

Flash the image on the module and setup QtCreator using the SDK as per this article.

Also, I would prefer not to use Qt Quick 2 if it uses OpenGL which requires hardware acceleration. Since our i.MX7 does not have a GPU we would not want to have to deal with the poor performance that results. It would be okay just to try and run the analog clock example as a test to prove that we can successfully build, debug, and deploy an application, but not as a final solution to building our GUI application.

Based on what I have gathered from this forum thread so far, and you can correct me if I’m wrong, it appears that we have the following options to build a stable GUI application that runs well:

Create a Qt Widgets only application without Qt Quick 2 support for a GPU (Is this the Qt Widgets Application template you can select from the New File or Project dialog box that appears in Qt Creator?)

or

Purchase a commercial copy of Qt For Device Creation which provides optimized support for using Qt Quick 2 on hardware that does not have a GPU such as our Colibri i.MX7D board.

In your experience which option would you recommend for rapidly developing a GUI based application for our device? Is one option better than the other?

Thanks again for all of your help with everything.

If Qt Quick 2 is an absolute requirement then one would have to opt for Qt for Device Creation to get a decent performance under the absence of any kind of GPU on iMX7 else using Qt Widgets is definitely a good option.

However please do consider the licensing requirements some of which is clarified here.

Thank you for the further information.

I’m still confused by the information that you are providing in your previous post. What are the lines?:

MACHINE=colibri-imx7 bitbake angstrom-qt5-x11-image

and

MACHINE=apalis-imx6 bitbake meta-toolchain-qt5

You are throwing me off with the MACHINE= in these lines. Are these lines that you add to your local.config file?

The OpenEmbedded (core) here states to add:

MACHINE ?= “colibri-imx7”

and later in the document:

bitbake -k angstrom-lxde-image

Also, there is also no MACHINE= for building the SDK per the document link text. What does your line: MACHINE=apalis-imx6 bitbake meta-toolchain-qt5 mean?

See the note here.

You can explicitly override the MACHINE setting on the cmdline, set the variable MACHINE when calling the bitbake command (e.g. MACHINE=apalis-t30 bitbake…)

It is possible to specify the machine from the command line while running the command.

MACHINE=colibri-imx7 bitbake angstrom-qt5-x11-image

specifies to build the image for Colibri iMX7 and

 MACHINE=apalis-imx6 bitbake meta-toolchain-qt5

specifies to build the SDK for Apalis iMX6.

Okay, I see. Thanks. I explicitly set

MACHINE ?= colibri-imx7

in the:

oe-core/build/conf/local.config

file and then called: bitbake angstrom-qt5-x11-image from the command line so I should be good. Everything seems to be building alright so far. I’m not seeing any errors at least.

I’ll use the line you provided:

MACHINE=apalis-imx6 bitbake meta-toolchain-qt5

when I build the SDK to make things easier.

Thank you for clarifying this. It makes sense now. I missed the note in the document that explained this.

Thanks again for all of your help with everything.