PDA

View Full Version : error: undefined reference to `__gxx_personality_v0' while using gstreamer library.



jils
10th February 2015, 07:28
Hi all,

I am trying to use GStreamer in QT application in Windows. To get the libraries linked to Qt application, i have included below lines into .pro file.

INCLUDEPATH +=E:\gstreamer\1.0\x86\include E:\gstreamer\1.0\x86\include\gstreamer-1.0 E:\gstreamer\1.0\x86\include\glib-2.0 E:\gstreamer\1.0\x86\lib\glib-2.0\include
LIBS += -L"E:\gstreamer\1.0\x86\lib" -lglib-2.0 -lgstreamer-1.0

while i run the application i get the below error.

:-1: error: undefined reference to `__gxx_personality_v0'


I am very new to QT environment. please easy go on me ;).

wysota
10th February 2015, 08:28
Seems like a compiler clash. What compiler are you using? What compiler was your GStreamer built with?

jils
10th February 2015, 10:32
Hi,

I have downloaded GStreamer file from the below link:

http://gstreamer.freedesktop.org/data/pkg/windows/1.4.5/

File Names: gstreamer-1.0-devel-x86-1.4.5.msi , gstreamer-1.0-x86-1.4.5.msi

I checked with Properties of the system : it shows 64 bit X86 machine.

QT Version:


Based on Qt 5.2.1 (MSVC 2010, 32 bit)

Built on Jan 31 2014 at 05:16:27

From revision 51af63bb9e


Kindly provide input.

jils
10th February 2015, 12:43
Could someone help me on this?

wysota
10th February 2015, 12:55
__gxx_personality_v0 should be a gcc symbol which would imply your gstreamer is built with MinGW and not MSVC. Either rebuild it with MSVC yourself or find MSVC compatible binaries.

jils
10th February 2015, 14:00
Thanks for reply. I am using MinGW compiler in the Qt Environment. And, i am using 32 bit compiled GStreamer binary to link.

Kindly let me know what other things i need to look at ?

wysota
10th February 2015, 14:23
Thanks for reply. I am using MinGW compiler in the Qt Environment. And, i am using 32 bit compiled GStreamer binary to link.

Kindly let me know what other things i need to look at ?

Does it work now?

d_stranz
10th February 2015, 14:41
You said this:


I am using MinGW compiler in the Qt Environment.

and you said this:



QT Version: Based on Qt 5.2.1 (MSVC 2010, 32 bit)


and who knows how your gstreamer distribution was built. At a minimum, the binaries in the Qt distribution are incompatible with the compiler you are using for your app.

As wysota has been patiently trying to tell you, you can't mix binaries from two different compilers when linking. Everything you link has to be compiled using the SAME compiler. So either rebuild everything you are using (Qt, gstreamer, your app, and any other libraries you link in) from source code or find distributions that were built with the same compiler you are using for your app. And of course everything has to be either 32-bit compiled or 64-bit compiled, not mix and match.

jils
10th February 2015, 15:18
Extremely sorry for the confusion. Initially i was linking with msvc, later then moved to minGW, based on wysota suggestion. But still not working. it looks like need to link with libstdc++. I am not sure what to add in .pro in order to link with libstdc++. would you mind pointing out?

d_stranz
10th February 2015, 15:31
Initially i was linking with msvc, later then moved to minGW

It is irrelevant what tool you are using to link with. If your Qt distro was built with MSVC, then you can't link it into an app (or with a library) built with mingw. If you want to use mingw, then you have to install a mingw-based Qt distro (or rebuild Qt from source code using mingw).

If you aren't doing that, then any link errors you are seeing are not due to missing libraries, but incompatibilities in what you are trying to link.

wysota
10th February 2015, 16:54
Extremely sorry for the confusion. Initially i was linking with msvc, later then moved to minGW, based on wysota suggestion. But still not working. it looks like need to link with libstdc++. I am not sure what to add in .pro in order to link with libstdc++. would you mind pointing out?

Libstdc++ is part of your MinGW distro.

jils
11th February 2015, 05:36
So, to conclude, to link with libraries compiled with mingw, the QT Distro itself should have compiled with mingw. that means i should take QT source code, and compile with mingw.

Is that the correct understanding? If so, we do have any ready built Qt distro?

wysota
11th February 2015, 08:18
So, to conclude, to link with libraries compiled with mingw, the QT Distro itself should have compiled with mingw. that means i should take QT source code, and compile with mingw.
Correct. All components of the equation need to built with compatible compilers.


Is that the correct understanding? If so, we do have any ready built Qt distro?
Because not everyone wants to use MSVC-built Qt with MinGW-built GStreamer.

ChrisW67
11th February 2015, 20:37
Based on Qt 5.2.1 (MSVC 2010, 32 bit)

Built on Jan 31 2014 at 05:16:27

From revision 51af63bb9e

This looks like the Qt version info returned by Qt Creator in its About box. This version has nothing to do with the version you are building your project with.

There a ready build Qt libraries for MingW and various Msvc versions available from the project site.
There is no information that I could see on the gstreamer site about which compilers were used to build their binaries. What is the name of the link library files in the distribution? Something.a or something.lib?Even if they are MingW built (seems less likely in an msi wrapper) they may be built with the older Gcc 4.4 which is not binary compatible with the current version for C++.