PDA

View Full Version : load gstreamer runtime library dll to QT4



israelariel
14th April 2015, 02:58
hello everybody. Iam using qt4 on windows and i having troubles by adding the main gstream runtime library libgstreamer-0.10-0.dll to the project.
I am already add the necessary libs and include in my .pro:

unix|win32: LIBS += -L$$PWD/C:/gstreamer-sdk/0.10/x86_64/lib/ \
C:/gstreamer-sdk/0.10/x86_64/lib/gstreamer-0.10.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gobject-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gmodule-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gthread-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/xml2.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/glib-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/intl.lib

INCLUDEPATH += C:/gstreamer-sdk/0.10/x86_64/include \
C:/gstreamer-sdk/0.10/x86_64/include/gstreamer-0.10 \
C:/gstreamer-sdk/0.10/x86_64/include/glib-2.0 \
C:/gstreamer-sdk/0.10/x86_64/lib/glib-2.0/include \
C:/gstreamer-sdk/0.10/x86_64/include/libxml2

DEPENDPATH += C:/gstreamer-sdk/0.10/x86_64/include \
C:/gstreamer-sdk/0.10/x86_64/include/gstreamer-0.10 \
C:/gstreamer-sdk/0.10/x86_64/include/glib-2.0 \
C:/gstreamer-sdk/0.10/x86_64/lib/glib-2.0/include \
C:/gstreamer-sdk/0.10/x86_64/include/libxml2

these information was extracted from the pkg-config application. however as i said i need to load the library at run time. The case is that the code:


QLibrary myLib("C:\gstreamer-sdk\0.10\x86_64\bin\libgstreamer-0.10-0.dll");
if(myLib.isLoaded())
qDebug("Loading done");
else
qDebug("Upppss");

return me "Upppss" every time. I just read the qlibrary doc but i can even load the library. Any help is appreciated.

Lesiok
14th April 2015, 09:01
First of all : ABC of C/C++ language. It should be :
QLibrary myLib("C:\\gstreamer-sdk\\0.10\\x86_64\\bin\\libgstreamer-0.10-0.dll");

anda_skoa
14th April 2015, 09:49
Or using forward slashes.

Cheers,
_

israelariel
15th April 2015, 02:52
still nothing:
i just tried with


QLibrary myLib("C:/gstreamer-sdk/0.10/x86_64/bin/libgstreamer-0.10-0.dll");
//and
QLibrary myLib("C:\\gstreamer-sdk\\0.10\\x86_64\\bin\\libgstreamer-0.10-0.dll");


thanks

Added after 16 minutes:

is there a chance that a dll cannot be load?
...
I already added gstreamer to Dev c++ an Visual studio but still cannot added to QT. However Qt is my primary interest. The only thin i need is to add the library at runtime becase gstreamer need to. I already added to the -L compilers flags in .pro file:



unix|win32: LIBS += -L$$PWD/C:/gstreamer-sdk/0.10/x86_64/lib/ \
C:/gstreamer-sdk/0.10/x86_64/bin/libgstreamer-0.10-0.dll \
C:/gstreamer-sdk/0.10/x86_64/lib/gstreamer-0.10.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gobject-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gmodule-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gthread-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/xml2.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/glib-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/intl.lib

still nothing
thanks

anda_skoa
15th April 2015, 06:43
The only thin i need is to add the library at runtime becase gstreamer need to.

Usually gstreamer is linked like any other library. What is your specific need of loading it manually?


I already added to the -L compilers flags in .pro file:



unix|win32: LIBS += -L$$PWD/C:/gstreamer-sdk/0.10/x86_64/lib/ \
C:/gstreamer-sdk/0.10/x86_64/bin/libgstreamer-0.10-0.dll \
C:/gstreamer-sdk/0.10/x86_64/lib/gstreamer-0.10.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gobject-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gmodule-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/gthread-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/xml2.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/glib-2.0.lib \
C:/gstreamer-sdk/0.10/x86_64/lib/intl.lib



Usually LIBS contains -L directives for paths and -l directives for libraries, e.g.


LIBS += -L/some/path -lsome_lib_name_without_extension


Cheers,
_

israelariel
15th April 2015, 11:04
the thing is that if i added in the .pro file as lib qt return to me an error of file format not recognized.
sorry for the trouble
thanks

anda_skoa
15th April 2015, 12:31
Can you post that error?

Maybe you have incompatible compilers or architectures (e.g. 32 vs 64it)

Cheers,
_

israelariel
15th April 2015, 13:09
the error is just what i just posted .. at building process, qt just return error of file format not recognized and open the dll code once i double-click on the error, by show me a lot of number sequence from the dll.
i using 64 bits arquitecture and qt 4.8.0, about dll...
well i just install the gstreamer using its own instaler and that process build by its own dlls, executables etc... but thing is that i can use the library with VS and the MInGW's comming with Devc++ IDE. What it does means?

Is there a test can i performance so things can be clearer?