Qt World Summit: Register Today!

undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent

  • Hi,
    i'm running Qt Creator 3.0.1 (Based on Qt 5.2.1 (GCC 4.8.2, 64 bit)) on Ubuntu 14.4 64bit on VirtualBox on Windows 7 64bit
    I'm trying to cross compile to Raspberry Pi and run very simple program:

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QMainWindow>

    namespace Ui {
    class MainWindow;

    class MainWindow : public QMainWindow

    explicit MainWindow(QWidget *parent = 0);

    protected slots:
    void ButtonClicked();

    Ui::MainWindow *ui;

    #endif // MAINWINDOW_H

    #include "MainWindow.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    MainWindow w;

    return a.exec();


    #include "MainWindow.h"
    #include "ui_MainWindow.h"
    #include <QMessageBox>

    MainWindow::MainWindow(QWidget *parent) :
    ui(new Ui::MainWindow)

    delete ui;

    void MainWindow::ButtonClicked()
    QMessageBox msgBox;
    msgBox.setText("Hello, World!");
    msgBox.setWindowTitle("VisualGDB Qt Demo");

    <?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
    <widget class="QMainWindow" name="MainWindow">
    <property name="geometry">
    <property name="windowTitle">
    <widget class="QWidget" name="centralWidget">
    <widget class="QPushButton" name="pushButton">
    <property name="geometry">
    <property name="text">
    <string>Press me</string>
    <widget class="QMenuBar" name="menuBar">
    <property name="geometry">
    <widget class="QToolBar" name="mainToolBar">
    <attribute name="toolBarArea">
    <attribute name="toolBarBreak">
    <widget class="QStatusBar" name="statusBar"/>
    <layoutdefault spacing="6" margin="11"/>
    <hint type="sourcelabel">
    <hint type="destinationlabel">


    Project created by QtCreator 2015-04-20T19:02:59


    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = OrianFirstTest
    target.files = OrianFirstTest
    target.path = /home/pi
    INSTALLS = target
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES +=

    FORMS +=

    HEADERS +=

    Running qmake is fine and building it as well.
    When I try to run it I see for a split second the GUI and I get this message:
    /home/pi/OrianFirstTest: symbol lookup error: /home/pi/OrianFirstTest: undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent
    Application finished with exit code 127.

    running on Raspberry Pi: "ldd OrianFirstTest" returns: "not a dynamic executable"
    running on Raspberry Pi: "echo _ZN7QWidget8qwsEventEP8QWSEvent | c++filt" returns: "QWidget::qwsEvent(QWSEvent*)"
    running on Raspberry Pi: "readelf -d OrianFirstTest" return: "
    Dynamic section at offset 0x400c contains 32 entries:
    Tag Type Name/Value
    0x000000 01 (NEEDED) Shared library: [libQtGui.so.4]
    0x00000001 (NEEDED) Shared library: [libQtNetwork.so.4]
    0x00000001 (NEEDED) Shared library: [libQtCore.so.4]
    0x00000001 (NEEDED) Shared library: [libpthread.so.0]
    0x00000001 (NEEDED) Shared library: [libstdc++.so.6]
    0x00000001 (NEEDED) Shared library: [libm.so.6]
    0x00000001 (NEEDED) Shared library: [libgcc_s.so.1]
    0x00000001 (NEEDED) Shared library: [libc.so.6]
    0x0000000f (RPATH) Library rpath: [/opt/qt/lib]
    0x0000000c (INIT) 0x9f64
    0x0000000d (FINI) 0xb74c
    0x00000019 (INIT_ARRAY) 0x14000
    0x0000001b (INIT_ARRAYSZ) 4 (bytes)
    0x0000001a (FINI_ARRAY) 0x14004
    0x0000001c (FINI_ARRAYSZ) 4 (bytes)
    0x00000004 (HASH) 0x8168
    0x00000005 (STRTAB) 0x8c04
    0x00000006 (SYMTAB) 0x84c4
    0x0000000a (STRSZ) 3806 (bytes)
    0x0000000b (SYMENT) 16 (bytes)
    0x00000015 (DEBUG) 0x0
    0x00000003 (PLTGOT) 0x14134
    0x00000002 (PLTRELSZ) 776 (bytes)
    0x00000014 (PLTREL) REL
    0x00000017 (JMPREL) 0x9c5c
    0x00000011 (REL) 0x9c3c
    0x00000012 (RELSZ) 32 (bytes)
    0x00000013 (RELENT) 8 (bytes)
    0x6ffffffe (VERNEED) 0x9bcc
    0x6fffffff (VERNEEDNUM) 3
    0x6ffffff0 (VERSYM) 0x9ae2
    0x00000000 (NULL) 0x0

    Please help me and guide me to fix it.
    Thanks a lot,

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I may be wrong bug it looks like you are building your application with a Qt 4 built with the -embedded option but running a standard Qt 4 on the RPI

  • @SGaist
    Hi, I succeed to run Hello World program with cross-compiling, thus I don't think so.
    Do you have a another idea?
    Thanks a lot!

  • Lifetime Qt Champion

    So you can run a default project but not yours ?

Log in to reply