PDA

View Full Version : how to create library from .pro file(project file and how to use library in applicati



amit_pansuria
7th June 2007, 11:14
helo, i have one LHMail project file
i want to create library file and want to use it in my application
now how to create library file and how to use this library in my application
what configuration i have to required for bulding library and using it from application
Best Regards,
Amit

magland
7th June 2007, 11:38
helo, i have one LHMail project file
i want to create library file and want to use it in my application
now how to create library file and how to use this library in my application
what configuration i have to required for bulding library and using it from application
Best Regards,
Amit

In your library project file, use TEMPLATE=lib. If you want a create a shared library use CONFIG += dll, and if you want to create a static library use CONFIG += staticlib.

Once the library is created, you can use LIBS += -L searchpath -l libname in your main application project file (see Qt docs). Be sure to #include the header file for your library....

amit_pansuria
7th June 2007, 12:15
In your library project file, use TEMPLATE=lib. If you want a create a shared library use CONFIG += dll, and if you want to create a static library use CONFIG += staticlib.

Once the library is created, you can use LIBS += -L searchpath -l libname in your main application project file (see Qt docs). Be sure to #include the header file for your library....

suppose i in my library project file i use TEMPLATE = lib .
now i want to create lib file then i have to give
#qmake project file
# make
if it will successfully compile then it will build .lib file
this is right or not.
and where i have to locate the lib file

Amit

croland
7th June 2007, 12:47
I'm working on using QT's plugin system to create libraries for my software. Here is the link to the doc section that talks about QT Plugins:

http://doc.trolltech.com/4.3/plugins-howto.html

Here is a post I made earlier with sample code for a plugin:
http://www.qtcentre.org/forum/f-qt-programming-2/t-qtplugin-compile-issue-7254.html/?highlight=plugin

*Note: You will need to fix the createWidget declaration in interface.h by making it a pure virtual function, like wysota was saying :).

Honestly, after reading through the plugin page, going over the paint example in the docs and creating a sample, it is really easy to extend your app through the QT Plugins.

giacomelli.fabio
18th December 2009, 19:55
Is it possible to convert it for qtcreator 1.3 ????