Embedded QT with QT-Creator,undefined symbols

296 views
Skip to first unread message

ksc...@3ztelecom.com

unread,
Nov 3, 2015, 2:13:50 PM11/3/15
to BeagleBoard
I followed the examples for setting up a QT cross build environment and an Arm-Linux-gnueabihf tool chain

I've also followed his directions on building QT for the BBB (arm-gueabihf)

The simple command line built program,

#include <QApplication>
#include <QLabel>
 
int main(int argc, char *argv[]){
   QApplication app(argc, argv);
   QLabel label("Hello BeagleBone!");
   label.resize(200, 100);
   label.show();
   return app.exec();
}



worked fine, I was able to sftp it to the target and run if locally in an LXDE xterm, or via ssh -XC.

However when I tried to build a simple widget application using QT creator I ran into various issues.

#include "widget.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }

#include "widget.h" Widget::Widget(QWidget *parent) : QWidget(parent) { } Widget::~Widget() { }

#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = 0);
    ~Widget();
};

#endif // WIDGET_H


The above project (main.ccp, widget.cpp, and widget.h) compiles and runs when built for the desktop, but when I sftp it
to the BBB and run it either way, I get a missing symbol error

./Test3: symbol lookup error: ./Test3: undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent

My BB is running the Linux distro it came with
uname -a
Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux

and I've installed QT on it via apt-get (rev 4.8.2).  The version of QT I built on my host build system is the same.

As an experiment I tried replacing the installed Qt libraries with the crossbuilt ones.  I then get a different error when trying to run the simple program on the BBB (either via SSH -XC or locally in the LXDE X term)

ebian@beaglebone:~/lib$ ./Test3    
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
No Qt for Embedded Linux server appears to be running.
If you want to run this program as a server,
add the "-qws" command-line option.

That "QWS" seems to mean something, it's buried in that missing symbol message.  The applications (both the command line version and the QT creator one) were both linked against the arm-gueabihf libraries built on the cross dev machine, but only the QT-creator (using the widget class) has the issues.  Simple examples built to run on the PC (Debian Jessie) run as expected.

Any ideas what I've got miss-configured here?






ksc...@3ztelecom.com

unread,
Nov 4, 2015, 11:17:48 AM11/4/15
to BeagleBoard
Some additional info.....
After replacing my libqtxxx libraries with the ones built on my development system for the bbb (armhf) and running an application on the BBB, adding the -qws command line option (and setting some environment variables to define the terminal device) the application does launch and display on the hdmi connected monitor on the bbb.  HOWEVER the entire screen turns green and moving the mouse cursor creates black boxes that erase the green under the cursor.  I can't click on the controls in the application.  This behavior doesn't change when the application is launched remotely via SSH, or a serial connected terminal, or via an xterm under LXDE on the BBB.
 

bremenpl

unread,
Dec 12, 2015, 2:48:48 PM12/12/15
to BeagleBoard
Hello there,
I am experiencing the exact same behaviour. I can build code in command line and it works but it doesnt when using qt creator. I get undefined symbol: _ZN7Qwidget8qwsEventEP8QWSEvent. Did you solve this issue maybe?

Robert Nelson

unread,
Dec 12, 2015, 2:51:33 PM12/12/15
to Beagle Board
On Sat, Dec 12, 2015 at 1:48 PM, bremenpl <brem...@gmail.com> wrote:
Hello there,
I am experiencing the exact same behaviour. I can build code in command line and it works but it doesnt when using qt creator. I get undefined symbol: _ZN7Qwidget8qwsEventEP8QWSEvent. Did you solve this issue maybe?


voodoo@hestia:~$ c++filt _ZN7Qwidget8qwsEventEP8QWSEvent
Qwidget::qwsEvent(QWSEvent*)

Regards,


--
Robert Nelson
https://rcn-ee.com/

krist...@gmail.com

unread,
Jun 29, 2017, 1:39:14 PM6/29/17
to BeagleBoard
I have an application run from xterm that also displays the black boxes under the mouse, was there a solution?
Reply all
Reply to author
Forward
0 new messages