I have cross-compiled executable file from QT 4.8.7. I am running it on a Raspberry PI (Ubuntu), with QT 4.8.7 and QT declarative module installed. When i run the executable file on my raspberry pi, i got the error message : undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent
. I don't know why I am getting this error as both installed QT versions are the same and arm-linux-gcc toolchain is same. Note : I am using Raspberry pi 2 Model B ver 1.1 and Ubuntu Mate Os.
- The desktop Ubuntu which I am cross-compiling from as shown via lsb_release:
$ lsb_release -id
???
- The exact version of Ubuntu MATE 16.04 installed on the Raspberry Pi 2B v1.1:
$ lsb_release -id
???
- The exact cross-compiler version on my build-system:
$ arm-linux-gnueabihf-g++ --version
???
- On the Pi my Qt 4 package version is as follows:
$ apt-cache policy libqt4-declarative
Installed: 4:4.8.7-dfsg-5ubuntu2
Candidate: 4:4.8.7-dfsg-5ubuntu2
- On the Ubuntu 16.04 desktop build environment the package version is:
$ apt-cache policy libqt4-declarative:armhf
???
- On the Pi, checking the Qt library binary shows it using X11, not QWS:
$ strings /usr/lib/arm-linux-gnueabihf/libQtDeclarative.so.4 | egrep 'qwsEvent|x11Event'
_ZN7QWidget8x11EventEP7_XEvent
- On the desktop build environment:
$ strings /usr/lib/arm-linux-gnueabihf/libQtDeclarative.so.4 | egrep 'qwsEvent|x11Event'
???
To install the Qt library in my cross-compiling build environment I did (???select the correct one and remove the other two):
- Configured and cross-compiled the Qt libraries from source (bad, and almost guaranteed to cause the windowing mismatch problem @jdonald linked)
- Ran
sudo dpkg --add-architecture armhf
, ensured my/etc/apt/sources.list
had the correct Xenial armhf ports sources, and ransudo apt-get update; sudo apt-get install libqt4-dev:armhf
(good) - Installed from a different source (???)
Searching for references to different windowing systems in my build directory turns up the following:
$ egrep -r qwsEvent my_build_dir/*
???
$ egrep -r x11Event my_build_dir/*
???