[Qt-creator] How to include libraries in Qt

Ladnar, Marc Marc.Ladnar at ksab.kroschu.com
Fri Feb 12 07:40:32 CET 2010


Hi Krishna,
 
ther is no difference in binding your static or dynamic library into
another app.
You just have to put this line into your app.pro file:
LIBS += -L[PATH_TO_YOUR_LIB] -l[LIB_NAME]
If your lib is called libxy, you will have to add -lxy, so leave the
part "lib".
Static libs are directly included into the binary, dynamic libs have to
be delivered with the app.
 
Adding Plugins into your app needs the QPluginLoader, it is documented
in QtAssistant. Plugins have to be delivered with the app, too.
 
Hope I could help, have a nice day.
 
Marc Ladnar

  _____  

Von: Krishna Achugatla [mailto:krishnaa at symbian.org] 
Gesendet: Freitag, 12. Februar 2010 00:24
An: Qt-creator at trolltech.com
Betreff: [Qt-creator] How to include libraries in Qt



Hi,


I have created a Qt SharedLibrary (e.g. MySharedLibrary) using
Qt-Creator. I followed the navigation steps "File"->"New File or
Project->Projects"->"C++ Library". Then choose the "Type" as "Shared
Library", gave name and it created the Shared Library. The created
shared lib has the necessary declarations and defines wrt Q_DECL_EXPORT.
I wrote few functions in that class, so that they can be accessed in
another application.

How do I include this Shared Library as part of another Qt Application?.
What are the necessary changes required to make to .pro file (like
adding LIBS variable) and source files of the app?. Please let me know
any documentation is available. If the documentation explains with code,
the necessary changes then it becomes very easy for developers.

Similarly it is good to have documentation about other two types of
libraries, viz. "Statically linked library" & "Plugin", how to include
them in an application with example code.

-Krishna.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20100212/c37f3c3d/attachment.html 


More information about the Qt-creator-old mailing list