PDA

View Full Version : an error: 'undefined symbol: _ZN7QWidget8qwsEventEP8QWSEvent'



scosdq
25th February 2015, 15:39
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:


export QTDIR=/Qt4_5_3forARM
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH


Then


#source /etc/profile


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 !

wysota
25th February 2015, 16:19
Does ldd ./Paint find all the needed libs?

scosdq
26th February 2015, 07:46
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.

wysota
26th February 2015, 08:18
What about readelf -h ./Paint and readelf -d ./Paint?

scosdq
26th February 2015, 09:02
What about readelf -h ./Paint and readelf -d ./Paint?
when execute 'readelf -h ./Paint', it shows:


ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0xa9a0
Start of program headers: 52 (bytes into file)
Start of section headers: 17112 (bytes into file)
Flags: 0x5000002, has entry point, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 10
Size of section headers: 40 (bytes)
Number of section headers: 31
Section header string table index: 28


when execute 'readelf -d ./Paint', it shows:


Dynamic section at offset 0x3eb8 contains 36 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libQtGui.so.4]
0x00000001 (NEEDED) Shared library: [libQtNetwork.so.4]
0x00000001 (NEEDED) Shared library: [libQtCore.so.4]
0x00000001 (NEEDED) Shared library: [librt.so.1]
0x00000001 (NEEDED) Shared library: [libdl.so.2]
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: [/Qt4_5_3forARM/lib]
0x0000001d (RUNPATH) Library runpath: [/Qt4_5_3forARM/lib]
0x0000000c (INIT) 0xa538
0x0000000d (FINI) 0xb130
0x00000019 (INIT_ARRAY) 0x13eac
0x0000001b (INIT_ARRAYSZ) 4 (bytes)
0x0000001a (FINI_ARRAY) 0x13eb0
0x0000001c (FINI_ARRAYSZ) 4 (bytes)
0x00000004 (HASH) 0x81a8
0x6ffffef5 (GNU_HASH) 0x86a0
0x00000005 (STRTAB) 0x92e0
0x00000006 (SYMTAB) 0x8c10
0x0000000a (STRSZ) 3598 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x14000
0x00000002 (PLTRELSZ) 728 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0xa260
0x00000011 (REL) 0xa238
0x00000012 (RELSZ) 40 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0xa1c8
0x6fffffff (VERNEEDNUM) 3
0x6ffffff0 (VERSYM) 0xa0ee
0x00000000 (NULL) 0x0

wysota
26th February 2015, 11:05
Hmm... when running ldd on the binary you did run it on Pi and not on your desktop, right?

scosdq
26th February 2015, 11:38
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.

wysota
26th February 2015, 12:22
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.

scosdq
26th February 2015, 15:33
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':


13651: OO1b7b8c 8 FUNC GLOBAL DEFAULT 11 _ZN7QWidget8qwsEventEP8QW
49614: OO1b7b8c 8 FUNC GLOBAL DEFAULT 11 _ZN7QWidget8qwsEventEP8QW

Is it normal? If so, does it mean the missing symbol is not there?

zingero
10th May 2015, 15:06
Hi,
I got the same problem.
Did you solve the issue?

Thanks a lot,
Orian.

Chrigou
24th June 2015, 10:07
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:



#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[]){
QApplication app(argc, argv);
QLabel label("Hello BeagleBone!");
label.resize(200, 100);
label.show();
return app.exec();
}


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.

Chrigou
25th June 2015, 08:44
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 ?

michaelll
15th October 2015, 13:58
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.

Chrigou
20th October 2015, 07:22
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