Adding a QtCreator Library to a Project
-
I Opened QtCreator, selected New Project and then Library, a C++ library. Now I want to add it to another Project: I am tired of using add new for both headers and sources for all the classes. I have that Library, but I cannot find a way to add it to another project--I was succssful in the past, but I forgot how I did it. I tried all the steps in the documentation to no avail. I did build the .pro file and it worked; however, I promoted Widget to one of the classes in the library. When I compiled I get an UI error that it cannot find the .h file of the promoted class. It seems to require the full path. I believe that I found the problem in the XML file generated by the designer, but the XML file is read only.
Does anyone know how to add a QtCreator Library, it is a directory, not as file; it contains the .h and .cpp files and a .pro file?
-
I Opened QtCreator, selected New Project and then Library, a C++ library. Now I want to add it to another Project: I am tired of using add new for both headers and sources for all the classes. I have that Library, but I cannot find a way to add it to another project--I was succssful in the past, but I forgot how I did it. I tried all the steps in the documentation to no avail. I did build the .pro file and it worked; however, I promoted Widget to one of the classes in the library. When I compiled I get an UI error that it cannot find the .h file of the promoted class. It seems to require the full path. I believe that I found the problem in the XML file generated by the designer, but the XML file is read only.
Does anyone know how to add a QtCreator Library, it is a directory, not as file; it contains the .h and .cpp files and a .pro file?
-
I have a subdir project with its .pro file. I build new subproject and add it to my project.
Then I change the new subproject .pro to "TEMPLATE = lib" and rebuild the entire project.
Then I add the new (internal) library using "add library " to my main .pro or to whatever subproject needs it. .
Little convoluted but reliable and repeatable.
( I am using Linux, if it makes a difference )