Solved Best way to generate library ?
-
Hello,
I'm new at c++/Qt programming and I'm searching what is the best way to generate a library from a Qt project ?
It seems that there is different possibilities over internet to build a library, but I can't choose which approach is the best for me.
I must generate a library from a Qt project and then, I will use objects of this library in an other Qt project but I don't know if I must create a static library, a dynamic or a shared ..
Thanks for your help and your explanation
-
Hi
It depends on your requirements
http://stackoverflow.com/questions/2649334/difference-between-static-and-shared-librariesIf you are not sure, I would go with dynamic/shared.
So maybe I can ask
Why do you need to make library ?
-
Thanks for your answer.
I need to make a library because I created a module on an independent project and now, I must add this module to an application.
I will check what you sent me.
-
hi
Qt has a system for loading dynamic library's in a platform independent way.
Its called plugins-Please notice this term is used both for extending Qt tools and for extending
an Qt applications.http://doc.qt.io/qt-5/plugins-howto.html
and
The Low-Level API: Extending Qt Applications -
Hum ok so I can extend a Qt applications with a plugins which will load my dynamic library, am I right ?
-
@Lordful
well the plugin IS the library.
and plugins can be loaded dynamically.
So yes.please see
http://doc.qt.io/qt-5/qtwidgets-tools-echoplugin-example.html
for really basic sample
here a string is returned from library.
Could have been anything. including UI and classes. -
Ok thanks for your informations, I will look at what you sent.
Thanks mrjj.