PDA

View Full Version : Intergrating Library Packages



Baasie
30th September 2009, 07:23
Goodday fellow qt'ers.

First let me start by saying that i looked everywhere for an asnwer but none solves mine.

ATM i downloaded 3 libraries they are called:

libIconv
libUSB
libMTP

These packages can just be found on internet and are used to use the MTP from windows.

Now what i want to know is how i can use these library packages in QT.

Since in libiconv and libmtp are configure files wich i can use with msys for mingw32 but i don't know if this is the correct way of doing it PLUS that libusb is an executable without the setting files.

so can please anyone help me so that i can use these 3 libraries in QT so that i can connect with an MTP device.

thanx in advance and if you need more info about anything feel free to ask.

regards Baasie

faldzip
30th September 2009, 08:00
as Qt is just a bunch of C++ classes (and some helpful tools) you write your programs in C++. So compile your libraries or find suitable compiled versions, add those libraries to your project (*.pro):


LIBS += -Lpath/to/library/dir -lnameofthelibrary

add paths to headers:


INCLUDEPATH += path/to/headers

and use them in your project.

Baasie
30th September 2009, 10:14
So all i need to do is link those 3 .dll's and i don't need to add the .a/.lib files ?


example



LIBS += -Llibs/libiconv/lib/.libs -llibiconv-2.dll




like this ?

but wich files do i need to add to the headers like you mentioned?

already thanx in advance

yogeshgokul
30th September 2009, 10:40
So all i need to do is link those 3 .dll's and i don't need to add the .a/.lib files ?
This depends upon how DLL is created. Sometime we may need to include the libs files at the compile time and supplying DLL at run time. But you can skip including lib files. Just include the header(If available). Other wise you need to manually resolve the DLL symbols. For that you can use QLibrary class.


LIBS += -Llibs/libiconv/lib/.libs -llibiconv-2.dll
like this ? No, never use .dll or .lib. Just use the name.


but wich files do i need to add to the headers like you mentioned
If header is available, then you need to include the libs at compile time. Otherwise use QLibrary to resolve the DLL symbols and using them in your application.

Baasie
30th September 2009, 11:14
Okey gonna try what you told me,

i have found the headers so i am gonna see if it works :)

many thanx for your quick reply on my post.

/bow


regards Baasie