Regarding the static library loading fails
-
A static lib must be linked into the application so QLibrary cannot be used.
(it will report error)- But still widget is showing.
so WidgetApplication comes from the static lib?
Normally it complains if cant link what you ask of it so it sounds like you are in fact using the static lib but only u can tell :)
-
Yes i have used static lib , inherited the class from QWidget. So i am calling the class name as WidgetApplication.
so .pro file of WidgetApplication. Is below
-
Ok so it seems to use the lib ?
So it was working :) -
Hmmmm
came to know when we want to allocate the memory using the libraries created , then we need to go for using the class QLibrary.
If we use static libraries linked to out application, memory will be allocated.Thanks,
-
Hmmmm
came to know when we want to allocate the memory using the libraries created , then we need to go for using the class QLibrary.
If we use static libraries linked to out application, memory will be allocated.Thanks,
@Pradeep-Kumar
Yes when using static lib, its 100% included into the application and you do not gain the feature on load on demand as you do
with shared libs. So if you need to only have it active is needed - than dynamic library is better.
Not that just linking the lib, might not use much extra as long no objects are allocated but the code is indeed
always compiled into the app and in that way takes extra memory. -
@Pradeep-Kumar
Yes when using static lib, its 100% included into the application and you do not gain the feature on load on demand as you do
with shared libs. So if you need to only have it active is needed - than dynamic library is better.
Not that just linking the lib, might not use much extra as long no objects are allocated but the code is indeed
always compiled into the app and in that way takes extra memory.@mrjj said in Regarding the static library loading fails:
@Pradeep-Kumar
Yes when using static lib, its 100% included into the application and you do not gain the feature on load on demand as you do
with shared libs. So if you need to only have it active ia needed - than dynamic library is better.
Not that just linking the lib, might not use much extra as long no objects are allocated but the code is indeed
always compiled into the app and in that way takes extra memory.Just explained nicely and ellaborated my previous post answer.
with the static lib, executable size also increases.Got it man.
-
@mrjj said in Regarding the static library loading fails:
@Pradeep-Kumar
Yes when using static lib, its 100% included into the application and you do not gain the feature on load on demand as you do
with shared libs. So if you need to only have it active ia needed - than dynamic library is better.
Not that just linking the lib, might not use much extra as long no objects are allocated but the code is indeed
always compiled into the app and in that way takes extra memory.Just explained nicely and ellaborated my previous post answer.
with the static lib, executable size also increases.Got it man.
@Pradeep-Kumar
executable size also increases.Indeed it does. A plain empty default project compiled with static Qt is around 15 MB as the Qt dlls are compiled into it.
For debug builds, it can get insane big. exe > 200 MB! -
Then if i have to use QLibrary then shared libraries comes into picture, and then only i can use it.
Hmmmmmmm:))))))))))
-
Then if i have to use QLibrary then shared libraries comes into picture, and then only i can use it.
Hmmmmmmm:))))))))))
@Pradeep-Kumar
If the lib is a Qt lib and the app that will use it - is a Qt app, I highly suggest you have a look at Qt plugins as
it is a smart(er?) way to use shared libs.http://doc.qt.io/qt-5/qtwidgets-tools-plugandpaint-app-example.html
The same way Creator uses its plugins , you can use for your app and libs.
it uses a interface design and its easier to handle than raw loading as it helps exporting QWidgets with more in
a nice manner. It takes a little to get up and running but after that its pretty easy to use.http://doc.qt.io/qt-5/qtwidgets-tools-echoplugin-example.html
-
Hi,
I got the output and it is working in multiple devices.
Thanks for the help and guidance provided.So marking as Solved.
Thanks,