[Error] undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent
-
hello everyone
i am using qt to develop apps for Beaglebone black board
My Desktop:- Ubuntu 14.04LTS
- qt5.5.1 opensource, qtcreator 3.5.1 opensource
I already compile qt4.8.2 for Beaglebone black follow:
http://exploringbeaglebone.com/chapter6/
And i tried to compile a little app by command line, this little app run on beaglebone black very smoothly.
But now i want to develop on qtcreator ide. So i set up qtcreator follow:
http://developer.toradex.com/knowledge-base/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux#Configure_Qt_Creator
but when run app built by qtcreator. it emit error:
undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent
please show me how to solve it
i am waiting your response as soon as
-
Hi,
Are you trying to build your Qt 4 code with Qt 5 ? If so the QWS related classes have been removed from Qt.
-
Do you have any in your code ?
-
Are you trying to run a Qt 4 build of your application against Qt 5 on your device ?
-
What version of Qt do you have on your target ? What linux distribution are you running on it ?
-
You also have an Ubuntu 14.04 running on your target ? If so, then you have a classic "desktop like" build of Qt on your target. That's why it can find the symbols related to QWS. Either rebuild your Qt without the embedded option or install your cross-compiled Qt on the target.
-
Then check how Qt was built for Angstrom but I suspect that it's a desktop like build rather than an embedded.
-
I found cause of this error, but i dont know how to solve it. That is:
when create new project on Qt(Ctr+N). Qt automatically create new class called mainwindow
and automatically create code in main.cpp which show mainwindow. in main.cpp:
MainWindow w;
w.show();
if build, then run, this error raised
but i replace this two command in main.cpp as following:
...
#include <QMainWindow>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);QMainWindow q; q.show(); return a.exec();
}
it run ok.
we see that mainwindow class inherite from QMainWindow class.
when show QMainWindow is ok, but show mainwindow is not ok
that isn't understand -
Do you do something special in MainWindows constructor?
-
Silly question but, are you using the same kit for both projects ?
-
i don't change anything, MainWindow class is created automatically by Qt creator
let me post code here. i can't find how to attach it
mainwindow.h content:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_HMainwindow.cpp content:
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
} -
Then there must be something else with your project.