[Interest] Linker error: undefined reference to symbol 'g_type_check_instance_cast'

Christian Gagneraud chgans at gna.org
Tue Aug 4 01:08:41 CEST 2015


On 04/08/15 08:50, vaishnavi nagarajan wrote:
> sounggst is one of my sources. It includes the gst.h header from
> gstreamer-1.0.
>
> That symbol is provided by libgobject-2.0. I have added the library in
> LIBS += as:
> QMAKE_LIBDIR_FLAGS += -L/usr/lib/x86_64-linux-gnu
>
> QMAKE_LFLAGS   += -lgmodule-2.0 \
>                            -lxml2 \
>                            -lgobject-2.0 \
>                            -lgthread-2.0 \
>                            -lrt \
>                            -lglib-2.0 \
>                            -lpthread \
>                            -lgstreamer-1.0

Try re-ordering them to respect the libs' own dependencies, as stated in 
the stackoverflow thread, something like:

-lgstreamer-1.0 -lxml2 \
-lgthread-2.0 -lgobject-2.0 \
-lglib-2.0 -lpthread -lrt

Krys

>
>
> I cross verified to make sure the library contains the symbol. I even
> upgraded my system. But still the error persists.
> I tried to follow the solutions provided in these links:
> http://stackoverflow.com/questions/19901934/strange-linking-error-dso-missing-from-command-line
>
> Thanks and Regards,
> Vaishnavi
>
>
>
> On Monday, August 3, 2015 6:03 PM, Thiago Macieira
> <thiago.macieira at intel.com> wrote:
>
>
> On Monday 03 August 2015 15:58:05 vaishnavi nagarajan wrote:
>  > /usr/bin/ld: soundgst.o: undefined reference to symbol
>  > 'g_type_check_instance_cast'
>
> There's no file called "soundgst" in the Qt sources. That means the
> error above
> comes from your sources.
>
> The function "g_type_check_instance_cast" is not a Qt one (probably Glib,
> given its name), so it's up to you to figure it out.
>
> Here's what you need to do:
> 1) what library provides that symbol? Have you checked the function's API
> documentation to see what library that is? Make sure that you have that
> library in LIBS +=
>
> 2) make sure the library actually contains that symbol. Use nm -D on the
> library to list all symbols and confirm it's there.
>
> 3) if it's not there, check where the symbol got declared from. Was it
> from a
> system-installed header? If so, you have mismatching header and library
> installations -- fix your system. If it got declared from your own
> sources, fix
> your sources.
>
>
>  > (kit: Desktop Qt 5.0.2 GCC 64bit)
>
>
> Upgrade. Now.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>    Software Architect - Intel Open Source Technology Center
>
>
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>




More information about the Interest mailing list