creating the library file
-
Hi all.
I am working on medical product development in which QT Gui is used with the in-built QT Library.
I'm concerned about creating the lib.a file that can be from the current project directory and further same library can be used in the other project.
Also, it needs to be build automatically when we build our main project.
To achieve the above task I tried and followed many steps available online but somehow I am unable to generate the same requirement.
I tried to add the library project-pro file in the main project's pro file, using the "include()", "SUBDIRS", few other steps as mentioned in the online steps.I request you to kindly support and share the proper build steps for creating the library file.
All the support and response will be highly appreciated.
Thanks
-
Hi,
The whole project should start as a SUBDIRS project and then each item should be an application or a library.
You seem to try to start from an application template and force it into a SUBDIRS which is wrong.
There's a wiki page about the subject.
-
Can we copy the generated the library.a file to specific location(path) after building it successfully.
(as I every time copy the new generated library.a file to the other location, and it will good to go if we can add some command in the project - ".pro" file through which it copy and replace the library.a file on specific location in each new build or changes.)
It will great of yours if you can share the steps to do it in the QT for linux environment.
-
If you mean that you want it to be located in a central place within the subdirs build tree, you can use
DESTDIR = $$OUT_PWD/../lib
. Then in the projects using that library, you can use something like:LIBS += -L$$OUT_PWD/../lib
to add that destination dir to the folder list to search the library for. -