Results 1 to 14 of 14

Thread: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

  1. #1
    Join Date
    Feb 2015
    Location
    Shanghai
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Question an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    I have cross-compiled a Qt program and put it on the Raspberry Pi B+.

    On my PC platform, the Qt version is 'qt-embedded-linux-opensource-src-4.5.3.tar.gz'. It is installed under directory ' /Qt4_5_3forARM ' on my PC.
    So I copied all the files under ' /Qt4_5_3forARM/lib ' to the board with the same directory.

    And I added the following two commands into '/etc/profile' on the raspberry-pi board:
    Qt Code:
    1. export QTDIR=/Qt4_5_3forARM
    2. export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
    To copy to clipboard, switch view to plain text mode 

    Then
    Qt Code:
    1. #source /etc/profile
    To copy to clipboard, switch view to plain text mode 

    But when I run the executable file(it has been cross-compiled, and for example, its name is 'Paint') on the board, it has an error: './Paint: symbol lookup error: ./Paint: undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'.

    So who knows what's the reason and how to solve it ?
    Thank you !

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Does ldd ./Paint find all the needed libs?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2015
    Location
    Shanghai
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Quote Originally Posted by wysota View Post
    Does ldd ./Paint find all the needed libs?
    Oh, no, it prints out:' not a dynamic executable'.
    But I don't know what problem this information indicates.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    What about readelf -h ./Paint and readelf -d ./Paint?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2015
    Location
    Shanghai
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Quote Originally Posted by wysota View Post
    What about readelf -h ./Paint and readelf -d ./Paint?
    when execute 'readelf -h ./Paint', it shows:
    Qt Code:
    1. ELF Header:
    2. Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
    3. Class: ELF32
    4. Data: 2's complement, little endian
    5. Version: 1 (current)
    6. OS/ABI: UNIX - System V
    7. ABI Version: 0
    8. Type: EXEC (Executable file)
    9. Machine: ARM
    10. Version: 0x1
    11. Entry point address: 0xa9a0
    12. Start of program headers: 52 (bytes into file)
    13. Start of section headers: 17112 (bytes into file)
    14. Flags: 0x5000002, has entry point, Version5 EABI
    15. Size of this header: 52 (bytes)
    16. Size of program headers: 32 (bytes)
    17. Number of program headers: 10
    18. Size of section headers: 40 (bytes)
    19. Number of section headers: 31
    20. Section header string table index: 28
    To copy to clipboard, switch view to plain text mode 

    when execute 'readelf -d ./Paint', it shows:
    Qt Code:
    1. Dynamic section at offset 0x3eb8 contains 36 entries:
    2. Tag Type Name/Value
    3. 0x00000001 (NEEDED) Shared library: [libQtGui.so.4]
    4. 0x00000001 (NEEDED) Shared library: [libQtNetwork.so.4]
    5. 0x00000001 (NEEDED) Shared library: [libQtCore.so.4]
    6. 0x00000001 (NEEDED) Shared library: [librt.so.1]
    7. 0x00000001 (NEEDED) Shared library: [libdl.so.2]
    8. 0x00000001 (NEEDED) Shared library: [libpthread.so.0]
    9. 0x00000001 (NEEDED) Shared library: [libstdc++.so.6]
    10. 0x00000001 (NEEDED) Shared library: [libm.so.6]
    11. 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1]
    12. 0x00000001 (NEEDED) Shared library: [libc.so.6]
    13. 0x0000000f (RPATH) Library rpath: [/Qt4_5_3forARM/lib]
    14. 0x0000001d (RUNPATH) Library runpath: [/Qt4_5_3forARM/lib]
    15. 0x0000000c (INIT) 0xa538
    16. 0x0000000d (FINI) 0xb130
    17. 0x00000019 (INIT_ARRAY) 0x13eac
    18. 0x0000001b (INIT_ARRAYSZ) 4 (bytes)
    19. 0x0000001a (FINI_ARRAY) 0x13eb0
    20. 0x0000001c (FINI_ARRAYSZ) 4 (bytes)
    21. 0x00000004 (HASH) 0x81a8
    22. 0x6ffffef5 (GNU_HASH) 0x86a0
    23. 0x00000005 (STRTAB) 0x92e0
    24. 0x00000006 (SYMTAB) 0x8c10
    25. 0x0000000a (STRSZ) 3598 (bytes)
    26. 0x0000000b (SYMENT) 16 (bytes)
    27. 0x00000015 (DEBUG) 0x0
    28. 0x00000003 (PLTGOT) 0x14000
    29. 0x00000002 (PLTRELSZ) 728 (bytes)
    30. 0x00000014 (PLTREL) REL
    31. 0x00000017 (JMPREL) 0xa260
    32. 0x00000011 (REL) 0xa238
    33. 0x00000012 (RELSZ) 40 (bytes)
    34. 0x00000013 (RELENT) 8 (bytes)
    35. 0x6ffffffe (VERNEED) 0xa1c8
    36. 0x6fffffff (VERNEEDNUM) 3
    37. 0x6ffffff0 (VERSYM) 0xa0ee
    38. 0x00000000 (NULL) 0x0
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Hmm... when running ldd on the binary you did run it on Pi and not on your desktop, right?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Feb 2015
    Location
    Shanghai
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Quote Originally Posted by wysota View Post
    Hmm... when running ldd on the binary you did run it on Pi and not on your desktop, right?
    Yes, I executed the command '$ldd ./Paint' on the terminal of Pi.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    It's hard to believe ldd told you it wasn't a dynamic executable. Especially that readelf does report a dynamic section.

    Anyway... run readelf -s (or nm) on libQtGui.so.4.5.3 in /Qt4_5_3forARM and grep the result for qws. See if the missing symbol is there. If not, then the library is compiled without qws support.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Feb 2015
    Location
    Shanghai
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Quote Originally Posted by wysota View Post
    It's hard to believe ldd told you it wasn't a dynamic executable. Especially that readelf does report a dynamic section.

    Anyway... run readelf -s (or nm) on libQtGui.so.4.5.3 in /Qt4_5_3forARM and grep the result for qws. See if the missing symbol is there. If not, then the library is compiled without qws support.
    I have run 'readelf -s libQtGui.so.4.5.3' in '/Qt4_5_3forARM/lib' and grep the result.
    There is no '_ZN7QWidget8qwsEventEP8QWSEvent'.
    But there are two lines of '_ZN7QWidget8qwsEventEP8QW':
    Qt Code:
    1. 13651: OO1b7b8c 8 FUNC GLOBAL DEFAULT 11 _ZN7QWidget8qwsEventEP8QW
    2. 49614: OO1b7b8c 8 FUNC GLOBAL DEFAULT 11 _ZN7QWidget8qwsEventEP8QW
    To copy to clipboard, switch view to plain text mode 
    Is it normal? If so, does it mean the missing symbol is not there?

  10. #10
    Join Date
    May 2015
    Posts
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Hi,
    I got the same problem.
    Did you solve the issue?

    Thanks a lot,
    Orian.

  11. #11
    Join Date
    Jun 2015
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Dear All,
    I have the same error and here are some information that can help to solve.
    I use cross compilation on Ubuntu14.04 with qt-everywhere-opensource-src-4.8.2.tar.gz and the target is a BeagleBone Black RevC where libraries Qt4.8.2 were installed.

    The goal is to run a graphical window created with QtCreator 3.4.2 onto the BBB (under debian/Angström).

    First, I created manually this simple program that runs perfectly on the BBB:

    Qt Code:
    1. #include <QApplication>
    2. #include <QLabel>
    3.  
    4. int main(int argc, char *argv[]){
    5. QApplication app(argc, argv);
    6. QLabel label("Hello BeagleBone!");
    7. label.resize(200, 100);
    8. label.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    Then I created the same program with QtCreator and this program does not run on the BBB, it says:
    undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent


    The two programs were compiled using the same Makefile except that the QtCreator Makefile contains 4 more files:
    - mainwindow.cpp
    - mainwindow.h
    - ui_mainwindow.h
    - moc_mainwindow.cpp

    The both programs gives same results with the command readelf -h and readelf -d (executed on BBB).
    The both programs uses exactly the same libraries.

    So what's missing on the BBB to run the QtCreator's program ?
    Thanks for help.

  12. #12
    Join Date
    Jun 2015
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Another interresting thing is that if I use QtDesigner Version 4.8.6 to build the popup, it works also very well on the BeagleBone Black.
    So it means there is some specific call created by QtCreator Version 3.4.2, but which one ?

  13. #13
    Join Date
    Oct 2015
    Posts
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Hi there,

    did someone found the solution to this problem?

    I am facing the same error when i use QT to crosscompile to the BBB.

  14. #14
    Join Date
    Jun 2015
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'

    Hello michaelll,

    I think there will never be a solution about this problem...
    For my side, I changed to Qt 5 and the problem is gone!

    Good luck

Similar Threads

  1. Replies: 3
    Last Post: 27th May 2014, 18:55
  2. Replies: 0
    Last Post: 10th May 2011, 15:58
  3. Strange undefined symbol error
    By mhoover in forum General Programming
    Replies: 3
    Last Post: 1st November 2010, 22:05
  4. Replies: 1
    Last Post: 22nd June 2010, 20:56
  5. undefined symbol in library
    By quickNitin in forum General Programming
    Replies: 1
    Last Post: 16th November 2006, 11:50

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.