QT on Colibri VF61: "bitbake -k meta-toolchain-qt5" - Errors

hi, I want to create a QT5 application on a colibri VF61. I followed the instructions from the Qt Creator to cross compile - Embedded Linux

First, I tried to create the image:

bitbake -k angstrom-qt5-x11-image

But that has returned errors. Next, I tried to create the image. Here I have inserted the QT-recipes in the config.log :

bitbake -k angstrom-lxde-image

That workes. The image was created and the VF61 is running.

Then I wanted to create the SDK for the image. First I tried it with the following command:

bitbake -k meta-toolchain-qt5

This returns a error like this one:

ERROR: Task (/home/sebastian/oe-core/build/../layers/meta-qt5/recipes-qt/qt5/qtwebkit_git.bb:do_compile) failed with exit code '1'

Then I tried it with the following command:

bitbake angstrom-lxde-image -c populate_sdk

No errors were returned here. But I can not find the qmake file.

What am I doing wrong? What is the right way to create QT5 applications for the VF61?
my OS is ubuntu 16.04.

I use the stable branch version 2.8 (core)

repo init -u http://git.toradex.com/toradex-bsp-platform.git -b LinuxImageV2.8

Hi @stsemant

What errors did you get when you launched the command: bitbake -k angstrom-qt5-x11-image?

The command bitbake -k meta-toolchain-qt5 is obsolete. You should not use it.

Can you share your local.conf file when you created the angstrom-lxde-image?

Best regards,
Jaski

What errors did you get when you launched the command: bitbake -k angstrom-qt5-x11-image?

ERROR: qtwebkit-5.9.7+gitAUTOINC+bd0657f98a-r0 do_compile: oe_runmake failed
ERROR: qtwebkit-5.9.7+gitAUTOINC+bd0657f98a-r0 do_compile: Function failed: do_compile (log file is located at /home/mantwill/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtwebkit/5.9.7+gitAUTOINC+bd0657f98a-r0/temp/log.do_compile.5751)
ERROR: Logfile of failure stored in: /home/mantwill/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtwebkit/5.9.7+gitAUTOINC+bd0657f98a-r0/temp/log.do_compile.5751
...
| ERROR: oe_runmake failed
| Makefile:353: recipe for target 'sub-Source-QtWebKit-pro-make_first-ordered' failed
| make: *** [sub-Source-QtWebKit-pro-make_first-ordered] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/mantwill/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/qtwebkit/5.9.7+gitAUTOINC+bd0657f98a-r0/temp/log.do_compile.5751)
NOTE: recipe qtwebkit-5.9.7+gitAUTOINC+bd0657f98a-r0: task do_compile: Failed
ERROR: Task (/home/mantwill/oe-core/build/../layers/meta-qt5/recipes-qt/qt5/qtwebkit_git.bb:do_compile) failed with exit code '1'
...
Summary: 2 tasks failed:
  virtual:native:/home/mantwill/oe-core/build/../layers/meta-qt5/recipes-qt/qt5/qtdeclarative_git.bb:do_compile
  /home/mantwill/oe-core/build/../layers/meta-qt5/recipes-qt/qt5/qtwebkit_git.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 4 ERROR messages shown, returning a non-zero exit code.

The command bitbake -k meta-toolchain-qt5 is obsolete. You should not use it.
Why not? What should I use then to get all the data necessary to develop QT projects on the host PC (GCC, GDB, qmake)?

Can you share your local.conf file when you created the angstrom-lxde-image?
local.conf

Hi

Why not? What should I use then to get all the data necessary to develop QT projects on the host PC (GCC, GDB, qmake)?

Since it is obsolete. You should use bitbake -k angstrom-qt5-x11-image -c populate_sdk

Best regards,
Jaski

bitbake -k angstrom-qt5-x11-image

works with

bitbake -k meta-toolchain-qt5

right?

and:

bitbake -k angstrom-lxde-image

should works with

bitbake angstrom-lxde-image -c populate_sdk

right? But it doesn’t works. After all these steps in https://developer.toradex.com/knowledge-base/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux I have no qmake-File.

No, bitbake -k meta-toolchain-qt5 is a specific SDK which is obsolete. That’s why you should build a corresponding SDK to your custom image by doing bitbake -k angstrom-qt5-x11-image -c populate_sdk.

Best regards,
Jaski

I successfully built the SDK with “bitbake -k angstrom-qt5-x11-image -c populate_sdk”. Thank you.
But now I have a little problem.
I’ve done the steps of add kit . I added QT-Version, GCC an GDB. In “Add Kit” I have to write into Qt mkspec this “/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++”
If I enter that appears a red exclamation point, which says that for this Qt version no mkspec can be found. In this directory are two files: qmake.conf & qtplatformdefs.h
The terminal outputs:

QByteArray ProjectExplorer::runGcc(const Utils::FileName&, const QStringList&, const QStringList&): "/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/arm-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-g++" "-xc++ -E -dM -m64 -D_REENTRANT -fPIC -" returned exit code 1: "arm-angstrom-linux-gnueabi-g++: error: unrecognized command line option '-m64'\n"

On the desktop, I can successfully create a QT application. If I want to do that on the target device, it will not work. in qtcreator:

/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/features/qmake_use.prf(6): 'take_first' is not a recognized replace function.
/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/qt5/mkspecs/features/qmake_use.prf(6): 'take_first' is not a recognized replace function.
Project ERROR: Library '' is not defined.
Project ERROR: Library '' is not defined.

The application has ended, return value 126.

The file is successfully placed in /home/root but can not be executed. The following error appears:

root@colibri-vf:~# ls
test
root@colibri-vf:~# ./test
-sh: ./test: cannot execute binary file: Exec format error

I have done all the steps in the run-up and therefore can not explain the error…

mantwill@mantwill-HP-Laptop-17-by1xxx:~$ . /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi
mantwill@mantwill-HP-Laptop-17-by1xxx:~$ 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
mantwill@mantwill-HP-Laptop-17-by1xxx:~$ qtcreator

I use ubuntu 16.04 as host.

In addition, I have to say that the X11 demo does not install all the QT modules, such as: QtSerialPort or QtVirtualKeyboard. How do I add these? About an entry in local.conf?

+IMAGE_INSTALL_append = " qtbase qtbase-plugins cinematicexperience liberation-fonts qtdeclarative qtimageformats qtmultimedia  qtquick1 qtquickcontrols2 qtquickcontrols qtserialport qtcharts qtvirtualkeyboard"
+PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

Can you do that somehow retrospectively?

I need an answer please

Hi

If I enter that appears a red exclamation point, which says that for this Qt version no mkspec can be found. In this directory are two files: qmake.conf & …

Could you share the qmake.conf file?

The file is successfully placed in /home/root but can not be executed. The following error appears:

You need to cross compile for ARM and not i386.

I have done all the steps in the run-up and therefore can not explain the error…

Was the compilation successful?

In addition, I have to say that the X11 demo does not install all the QT modules, such as: QtSerialPort or QtVirtualKeyboard. How do I add these? About an entry in local.conf?

Yes, adding to local.conf is the correct way.

Best regards,
Jaski

You need to cross compile for ARM and not i386.

Okay, how do I do that??? As I said, I have followed the instructions from the page https://developer.toradex.com/knowledge-base/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux and https://developer.toradex.com/knowledge-base/board-support-package/openembedded-(core).

Yes, adding to local.conf is the correct way.

I will cross compile everything again and then report the result.

I’ve re-set everything up, here are the commands I used:

sudo apt install qt5-default qtcreator qt5-doc qt5-doc-html qtbase5-doc-html qtbase5-examples -y
sudo apt install qtcreator qt5-doc qt5-doc-html qtbase5-doc-html qtbase5-examples -y
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install g++-5-multilib -y
sudo apt-get install curl dosfstools gawk g++-multilib gcc-multilib lib32z1-dev libcrypto++9v5:i386 libcrypto++-dev:i386 liblzo2-dev:i386 lzop libsdl1.2-dev libstdc++-5-dev:i386 libusb-1.0-0:i386 libusb-1.0-0-dev:i386 uuid-dev:i386 texinfo chrpath git -y
cd /usr/lib; sudo ln -s libcrypto++.so.9.0.0 libcryptopp.so.6
cd ~
mkdir ~/bin
export PATH=~/bin:$PATH
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
git config --global user.name "XXX"
git config --global user.email XXX
mkdir oe-core
cd oe-core
repo init -u http://git.toradex.com/toradex-bsp-platform.git -b LinuxImageV2.8
repo sync
. export

nano conf/local.conf
	select: MACHINE ?= "colibri-vf"
	add: ACCEPT_FSL_EULA = "1"
# add under: PREFERRED_PROVIDER_psplash-support = "psplash-angstrom"
+IMAGE_INSTALL_append = " qtbase qtbase-plugins cinematicexperience liberation-fonts qtdeclarative qtimageformats qtmultimedia  qtquick1 qtquickcontrols2 qtquickcontrols qtserialport qtcharts qtvirtualkeyboard"
+PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

bitbake -k angstrom-qt5-x11-image 
bitbake -k angstrom-qt5-x11-image -c populate_sdk

sudo tar xjvf Colibri-VF_Qt5-X11-Image_2.8b6-20191102.tar.bz2
./update.sh -o /media/mantwill/DATA/
run setupdate
run update

../deploy/sdk/angstrom-glibc-x86_64-armv7at2hf-neon-v2016.12-toolchain.sh
. /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi

While adding the kit, I still have no mkspec for the Qt version. I then tried to continue without this information. On the desktop I can run a Qt program. But if I want to do that on the device, I get the error “Can not execute binary file: Exec format error”, it returns 126. I have uploaded the files local.conf and qmake.conf. I hope you can help me with what it is. I urgently need an answer.

files

Hi @stsemant

Thanks for the files. I am trying to reproduce this issue on my side.

But if I want to do that on the device, I get the error “Can not execute binary file: Exec format error”, it returns 126. I have uploaded the files local.conf and

If you try to run the binary running on your desktop on the target, this won’t work. For the target, the binary must be compiled for the architecture ARM.

Best regards,
jaski

For the target, the binary must be compiled for the architecture ARM.

How can I compile the binary for the ARM architecture?

You need to install SDK and setup your environment for cross compiler as described here.

Before compiling, you can check if the Environment is set correctly by doing the following command:

echo $ARCH
You should see arm

Best regards,
Jaski

You need to install SDK and setup your environment for cross compiler as described here.

As I said earlier, I followed this guide. This is also reflected in the commands I used and posted.

Before compiling, you can check if the Environment is set correctly by doing the following command: echo $ARCH
You should see arm

When I enter this command, I get “arm”.
What could it be?

Thanks for the files. I am trying to reproduce this issue on my side.

Did you meanwhile replicate the system? Can you recognize what I am doing wrong?
I just want to get a Qt5 application running on a Colibri VF61

Can you please post all commands necessary to develop a Qt5 application for a VF61 on a ubuntu 16.04 host? I need the Qt5 modules serialport, virtualkeyboard and qml. I really do not know what to do anymore and I really need help.

Dear @stsemant

I now tried everything on myself and followed the steps in the guides and I have no problem to run an empty Qt Quick Application on the target. I also appended the same packages in the local.conf as you did.

First I followed the OpenEmbbedded (Core) Guide to initiate the repository. Initialised with the BSP 2.8:

repo init -b LinuxImage2.8
repo sync

Then going forward in the folder with . export, adding the following two lines to my config/local.conf (because you want these packages as well) and uncomment the line MACHINE ?= "colibri-vf":

IMAGE_INSTALL_append = " qtbase qtbase-plugins cinematicexperience liberation-fonts qtdeclarative qtimageformats qtmultimedia  qtquick1 qtquickcontrols2 qtquickcontrols qtserialport qtcharts qtvirtualkeyboard"

PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

After that, I first built the image and then the sdk:

bitbake -k angstrom-qt5-x11-image
bitbake -k angstrom-qt5-x11-image -c populate_sdk

The image is in the folder deploy/images/colibri-vf/ and the sdk in the folder deploy/sdk/. If anything didn’t work properly until here, you may want to restart at the beginning and delete all your local data in oe-core.

Copy now these files to your development host and install the image to your target as described in this article.
Install the sdk as described here.

Before you start your QtCreator it’s important that you setup the environment in the same command line as you start the QtCreator afterwards. Do it like that:

. /path/to/your/sdk/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi
qtcreator

Following all these steps, you should really be able to configure your QtCreator with these instructions without any issues.

Additional hints:

  • When creating the Qt project, you also need to select the proper “minimal required Qt version” <= 5.9
  • Select the Kit you just created in the steps above
  • Add the target path as described at the bottom of this article to your *.pro file

Regards
Diego

I have followed all your steps, here again the commands:

sudo apt-get install geany gparted gtkterm build-essential python-serial -y
sudo apt install qtcreator qt5-doc qt5-doc-html qtbase5-doc-html qtbase5-examples -y
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install g++-5-multilib -y
sudo apt-get install curl dosfstools gawk g++-multilib gcc-multilib lib32z1-dev libcrypto++9v5:i386 libcrypto++-dev:i386 liblzo2-dev:i386 lzop libsdl1.2-dev libstdc++-5-dev:i386 libusb-1.0-0:i386 libusb-1.0-0-dev:i386 uuid-dev:i386 texinfo chrpath git -y
cd /usr/lib; sudo ln -s libcrypto++.so.9.0.0 libcryptopp.so.6
cd
mkdir ~/bin
export PATH=~/bin:$PATH
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
git config --global user.name "xxx"
git config --global user.email xxx
mkdir oe-core
cd oe-core
repo init -u http://git.toradex.com/toradex-bsp-platform.git -b LinuxImageV2.8
repo sync
. export
nano conf/local.conf
bitbake -k angstrom-qt5-x11-image
bitbake -k angstrom-qt5-x11-image -c populate_sdk
../deploy/sdk/angstrom-glibc-x86_64-armv7at2hf-neon-v2017.12-toolchain.sh
. /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi
echo $OE_QMAKE_CXX
qtcreator

I have, as previously described before, again the problem that the mkspecs can not be found for this Qt version. look at [upload|R8+4Fc1b6gCUTRRe25NZzdZ7xPg=]

If I omit the field with the mkspecs path and keep trying, I will not be able to run my program on the VF61. See the following pictures:

[upload|cpPYBaCMp9ntdE06F3nt50GiKSA=] [upload|Ml0vaazvtrnOpAAnyfbOFsO6apA=] [upload|cxrsOc2YvMwpFPhrSmNzouO/Nus=]

So I still have the same problem.
.
What I also notice is that I can only add one GCC to compiler, but not G ++. Why is that?

Hi @stsemant

It seems like you do everything properly. Did you make sure that you open the QtCreator in the same console as you sourced your environment with . /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi? You can also check if the environment is setup properly by hitting echo $OE_QMAKE_CXX, this should print you some details about your toolchain. Does this work and what does it print?

This is all done on your host machine, right? Beside that, did you install the related image on the VF61?

And beside the questions above, could you send me following details:

  • Screenshot of QtCreator → Options → Erstellung und Ausführung → Compilers (GCC_embedded selected)
  • Screenshot of QtCreator → Options → Erstellung und Ausführung → CMake
  • Screenshot of QtCreator → Projekte (in the left panel) (“Build” of your target selected)

Regards
Diego