[Error] undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent



  • hello everyone
    i am using qt to develop apps for Beaglebone black board
    My Desktop:


  • Lifetime Qt Champion

    Hi,

    Are you trying to build your Qt 4 code with Qt 5 ? If so the QWS related classes have been removed from Qt.



  • thank SGaist
    yes, i want to build Qt4 code base on Qt5.
    please show me how to remove QWS related classes?


  • Lifetime Qt Champion

    Do you have any in your code ?



  • i don't see QWS classe in my code


  • Lifetime Qt Champion

    Are you trying to run a Qt 4 build of your application against Qt 5 on your device ?



  • @SGaist said:

    Are you trying to run a Qt 4 build of your application against Qt 5 on your device ?

    i still don't try it.
    but i just have ran application with option -qws.
    but it don't discard this error.


  • Lifetime Qt Champion

    What version of Qt do you have on your target ? What linux distribution are you running on it ?



  • my target is using qt4
    my linux distribution is ubuntu lts 14.04


  • Lifetime Qt Champion

    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.



  • No, my target use Angstrom os, which was distributed with board


  • Lifetime Qt Champion

    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


  • Moderators

    Do you do something special in MainWindows constructor?



  • No, Qt automatically create it. i don't change ever


  • Lifetime Qt Champion

    Silly question but, are you using the same kit for both projects ?



  • yes, I use same kit for two


  • Lifetime Qt Champion

    Then as @jsulm asked, what are you doing in your MainWindow class that differs it from QMainWindow ?



  • 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_H

    Mainwindow.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;
    }


  • Lifetime Qt Champion

    Then there must be something else with your project.



  • I created C++ class manually, this class calls abc and inherited from QMainWindow class
    source code of abc.h:

    #ifndef ABC_H
    #define ABC_H
    #include <QMainWindow>
    class abc : public QMainWindow
    {
        Q_OBJECT
    public:
        explicit abc(QWidget *parent = 0);
    signals:
    public slots:
    };
    #endif // ABC_H
    

    source code of abc.cpp:

    #include "abc.h"
    abc::abc(QWidget *parent) : QMainWindow(parent)
    {
    
    }
    

    source of main.cpp:

    #include "mainwindow.h"
    #include <QApplication>
    #include "abc.h"
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    //    MainWindow w;
    //    w.show();
    //    QMainWindow q;
    //    q.show();
        abc abc1;
        abc1.show();
        return a.exec();
    }
    

    when app run on beagbone black, this error still rises


  • Lifetime Qt Champion

    There's something illogical here so lets try to summaries things:
    First case:

    1. You create a default widget project with Qt Creator
    2. Replace the MainWindow call in main.cpp by a QMainWindow
    3. Build it with your cross-compiled Qt
    4. Runs on BBB

    Second case:

    1. You create a default widget project with Qt Creator
    2. You keep the MainWindow class
    3. Build it with your cross-compiled Qt
    4. Fails to run on BBB complaining about QWS

    In both case, you use the exact same version of Qt to build (i.e. cross-compile) the projects.

    Is the summary correct ?



  • yes, you are right. but you miss the third case.
    because i have three cases.
    the third case:

    • I create a default widget project with Qt Creator
    • I create a new class (name is ABC) which inherite from QMainWindow (source code I posted at #21)
    • Replace the MainWindow class in main.cpp by ABC class
    • Build it with your cross-compiled Qt
    • Fails to run on BBB complaining about QWS
      All of three cases, i use same KIT (included device, compiler, qmake,...)

  • Lifetime Qt Champion

    I must say that it defies logic...



  • sorry, i don't understand
    all three cases is different.
    the third case i don't use class which automatically create by Qt creator, i created manually


  • Lifetime Qt Champion

    That's why it defies logic. I don't see why a simple derived class would trigger that error.

    Can you run ldd on all three applications on your target and post the output ?



  • output of case1 (application run ok):
    libQtGui.so.4 => /usr/lib/arm-linux-gnueabihf/libQtGui.so.4 (0xb681e000)
    libQtCore.so.4 => /usr/lib/arm-linux-gnueabihf/libQtCore.so.4 (0xb6616000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb656b000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6547000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6462000)
    libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6436000)
    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb641a000)
    libaudio.so.2 => /usr/lib/arm-linux-gnueabihf/libaudio.so.2 (0xb6402000)
    libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb6343000)
    libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0xb6322000)
    libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6309000)
    libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb62a4000)
    libgobject-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 (0xb6265000)
    libSM.so.6 => /usr/lib/arm-linux-gnueabihf/libSM.so.6 (0xb6258000)
    libICE.so.6 => /usr/lib/arm-linux-gnueabihf/libICE.so.6 (0xb6240000)
    libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0xb6232000)
    libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb621f000)
    libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6136000)
    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb60cb000)
    /lib/ld-linux-armhf.so.3 (0xb6f02000)
    libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb60c0000)
    librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb60b2000)
    libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb6090000)
    libXt.so.6 => /usr/lib/arm-linux-gnueabihf/libXt.so.6 (0xb604e000)
    libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6044000)
    libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb600b000)
    libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0xb6001000)
    libffi.so.5 => /usr/lib/arm-linux-gnueabihf/libffi.so.5 (0xb5fef000)
    libuuid.so.1 => /lib/arm-linux-gnueabihf/libuuid.so.1 (0xb5fe3000)
    libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb5fc8000)
    libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb5fbd000)
    output of case2 ( keep the MainWindow class):
    libQtGui.so.4 => /usr/lib/arm-linux-gnueabihf/libQtGui.so.4 (0xb68fd000)
    libQtCore.so.4 => /usr/lib/arm-linux-gnueabihf/libQtCore.so.4 (0xb66f5000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb664a000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6626000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6541000)
    libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6515000)
    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb64f9000)
    libaudio.so.2 => /usr/lib/arm-linux-gnueabihf/libaudio.so.2 (0xb64e1000)
    libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb6422000)
    libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0xb6401000)
    libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb63e8000)
    libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb6383000)
    libgobject-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 (0xb6344000)
    libSM.so.6 => /usr/lib/arm-linux-gnueabihf/libSM.so.6 (0xb6337000)
    libICE.so.6 => /usr/lib/arm-linux-gnueabihf/libICE.so.6 (0xb631f000)
    libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0xb6311000)
    libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb62fe000)
    libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6215000)
    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb61aa000)
    /lib/ld-linux-armhf.so.3 (0xb6fe1000)
    libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb619f000)
    librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6191000)
    libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb616f000)
    libXt.so.6 => /usr/lib/arm-linux-gnueabihf/libXt.so.6 (0xb612d000)
    libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6123000)
    libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb60ea000)
    libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0xb60e0000)
    libffi.so.5 => /usr/lib/arm-linux-gnueabihf/libffi.so.5 (0xb60ce000)
    libuuid.so.1 => /lib/arm-linux-gnueabihf/libuuid.so.1 (0xb60c2000)
    libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb60a7000)
    libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb609c000)
    output of case3 (use abc class):
    libQtGui.so.4 => /usr/lib/arm-linux-gnueabihf/libQtGui.so.4 (0xb681c000)
    libQtCore.so.4 => /usr/lib/arm-linux-gnueabihf/libQtCore.so.4 (0xb6614000)
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6569000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6545000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6460000)
    libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6434000)
    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6418000)
    libaudio.so.2 => /usr/lib/arm-linux-gnueabihf/libaudio.so.2 (0xb6400000)
    libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb6341000)
    libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0xb6320000)
    libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6307000)
    libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb62a2000)
    libgobject-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 (0xb6263000)
    libSM.so.6 => /usr/lib/arm-linux-gnueabihf/libSM.so.6 (0xb6256000)
    libICE.so.6 => /usr/lib/arm-linux-gnueabihf/libICE.so.6 (0xb623e000)
    libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0xb6230000)
    libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb621d000)
    libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6134000)
    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb60c9000)
    /lib/ld-linux-armhf.so.3 (0xb6f00000)
    libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb60be000)
    librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb60b0000)
    libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb608e000)
    libXt.so.6 => /usr/lib/arm-linux-gnueabihf/libXt.so.6 (0xb604c000)
    libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6042000)
    libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb6009000)
    libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0xb5fff000)
    libffi.so.5 => /usr/lib/arm-linux-gnueabihf/libffi.so.5 (0xb5fed000)
    libuuid.so.1 => /lib/arm-linux-gnueabihf/libuuid.so.1 (0xb5fe1000)
    libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb5fc6000)
    libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb5fbb000)


  • Lifetime Qt Champion

    So there's indeed something funky going on. On your target you have your application loading the "desktop Qt 4" while you are cross-compiling on your machine.

    So again, if you are using your application with QWS on the target, install your cross-compiled Qt on it. If not, cross-compile Qt 4 again but not for embedded.



  • output ldd of case 1 and case 2 is same.
    case 1 is ok. but, case 2 is not ok. why?


  • Lifetime Qt Champion

    Like I said, from your description that's pretty mysterious. Did you try to run them with your cross-compiled Qt installed on the target ?




Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.