Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Error] undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent
Qt 6.11 is out! See what's new in the release blog

[Error] undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
31 Posts 3 Posters 10.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    Do you have any in your code ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rocket42
      wrote on last edited by
      #5

      i don't see QWS classe in my code

      hung.rocket42@gmail.com

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #6

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        R 1 Reply Last reply
        0
        • SGaistS SGaist

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

          R Offline
          R Offline
          rocket42
          wrote on last edited by rocket42
          #7

          @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.

          hung.rocket42@gmail.com

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #8

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

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rocket42
              wrote on last edited by
              #9

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

              hung.rocket42@gmail.com

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #10

                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.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  rocket42
                  wrote on last edited by
                  #11

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

                  hung.rocket42@gmail.com

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    Then check how Qt was built for Angstrom but I suspect that it's a desktop like build rather than an embedded.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      rocket42
                      wrote on last edited by rocket42
                      #13

                      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

                      hung.rocket42@gmail.com

                      1 Reply Last reply
                      0
                      • jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #14

                        Do you do something special in MainWindows constructor?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          rocket42
                          wrote on last edited by
                          #15

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

                          hung.rocket42@gmail.com

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #16

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

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • R Offline
                              R Offline
                              rocket42
                              wrote on last edited by
                              #17

                              yes, I use same kit for two

                              hung.rocket42@gmail.com

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #18

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

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • R Offline
                                  R Offline
                                  rocket42
                                  wrote on last edited by
                                  #19

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

                                  hung.rocket42@gmail.com

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #20

                                    Then there must be something else with your project.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • R Offline
                                      R Offline
                                      rocket42
                                      wrote on last edited by rocket42
                                      #21

                                      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

                                      hung.rocket42@gmail.com

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #22

                                        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 ?

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • R Offline
                                          R Offline
                                          rocket42
                                          wrote on last edited by rocket42
                                          #23

                                          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,...)

                                          hung.rocket42@gmail.com

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved