Skip to content
Advertisement

Qt application autorun on linux embedded – “xcb” error

I develop software in Qt for a microcomputer based on Cortex imx6. On this platform, I have installed Linux prepared for this uP and Qt.

uname -a

Linux colibri-imx6 4.1.35-v2.7b1+gc1177831f5a1 #11 SMP Tue Jun 20 13:05:01 CEST 2017 armv7l armv7l armv7l GNU/Linux

I want to run my app during system startup and I have a problem with this. I wrote a basic service for this:

/etc/init.d/panel-service.sh:

JavaScript

/home/root/panel.sh:

JavaScript

After rebooting my device, I got an error:

QML debugging is enabled. Only use this in a safe environment. This application failed to start because it could not find or load the Qt platform plugin “xcb” in “”.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen.

Reinstalling the application may fix this problem. /media/sdcard/panel.sh: line 11: 410 Aborted panel

/home/root/panel

It’s strange, because my app don’t use libxcb.so…

ldd panel

JavaScript

I tried to add script to /etc/profile.d with the same error and I set auto log on root during system loading, but with no other results. When I run app or service after full system load from terminal, everything works fine and the app starts, so I have all of the necessary libraries. I don’t know why it doesn’t start after reboot.

Differents in env between time, when script is call and full system load. Script call moment:

JavaScript

After system load:

JavaScript

Can I set QT env variables which aren’t set during system starting?

Advertisement

Answer

In my case the point is to set Qt env variables in bash script using export. Below last version of my script:

JavaScript

It work like a charm. 🙂

Advertisement