0

I'm having some trouble correctly linking the gstreamer library in qmake.

So, I have library I wrote which uses gstreamer, I added this lines to the .pro file:

INCLUDEPATH += ../OtherLibs/GStreamer/Include
INCLUDEPATH += ../OtherLibs/GStreamer/Include/glib-2.0
INCLUDEPATH += ../OtherLibs/GStreamer/Include/libxml2
LIBS += -L../OtherLibs/GStreamer/Lib -lgobject-2.0 -lgstreamer-0.10 -lglib-2.0 -lgstapp-0.10

I run qmake and then compile and I don't get any error messages at all.

I use this library in another Qt project and I get:

WTAV.lib(contentvideo.obj):-1: error: LNK2019: unresolved external symbol g_assertion_message_expr referenced in function "protected: void __cdecl ContentVideo::load(class QString)" (?load@ContentVideo@@IEAAXVQString@@@Z)

and

WTAV.lib(mediapipeline.obj):-1: error: LNK2001: unresolved external symbol g_assertion_message_expr

I know that the paths to the headers and libs are correct because I get compile errors like "gst/gst.h not found" when I change them.

I have no idea what I might be doing wrong, maybe someone can point me in the right direction.

Thanks in advance.

SOLVED:

I was compiling the project with a 64bit compiler and using the 32bit gstreamer SDK... Thank you Pavel Krasavin for pointing out that it could be the problem.

Pedro Leal
  • 183
  • 1
  • 10
  • 1
    what files are within `../OtherLibs/GStreamer/Lib`? does it contain the specified libraries? – m.s. May 19 '15 at 14:42
  • Yes. It's really strange. I recently migrated from qt 5.1 to 5.4. In 5.1 the same project still works on 5.1. The path to the library ia different but I've done the necessary changes. I'm wondering about the origin of the problem. Might it be in my library that uses gstreamer or in the application where I call my library? – Pedro Leal May 19 '15 at 17:48

1 Answers1

1

g_assertion_message_expr() is exported by libglib-2.0.so. You should check this library is available at your path (-L../OtherLibs/GStreamer/Lib). Also, check this library has the same architecture as your project.

Pavel Krasavin
  • 165
  • 2
  • 11
  • I only have lib files there. I migrated recently from qt 5.1 to 5.4 and in the older version gstreamer works as intended. I started the project in 5.1 and recompiled it after the update to version 5.4. Might that have to do with anything? It's strange because all my other projects work with the new version – Pedro Leal May 19 '15 at 17:53
  • You need to add glib-2.0 library to your new project also, because it cannot find function _g_assertion_message_expr()_. So, add `LIBS += -L -lglib-2.0`. – Pavel Krasavin May 20 '15 at 08:16
  • I had added but still no go. I know it is hard to figure it out without with the information I am giving you. I mainly wanted to be sure that i was doing things correctly (obviously something is missing). You think the problem might be in the library WTAV or in the project that calls WTAV? Thank you for your help Pavel – Pedro Leal May 20 '15 at 08:55
  • 1
    I assumed I was using a x86 compiler because the build path had 32bit in its name. I checked which was the default compiler and saw that it was 64bit. So you were right in the first place! Thanks Pavel and sorry for doubting you in the first place ^^. Regards – Pedro Leal May 20 '15 at 09:55