Statically Link Libraries

  • Hi everyone,

    The subproject and the main project should have different .exe file.
    Could anyone suggest me how to change the .pro file of main project and the subproject. Or how to statically link the main project libraries to the subproject.

    Suggestions are appreciated. Thank you.

  • Lifetime Qt Champion


    Split things properly and then set proper order of build.

    Start by the library and then build the two executables.

    Each application is just a classic app template. Nothing special about them.

  • Okay. Thank you for your reply. I will check and get back to you.

  • In the main project I am using GUI and in subproject I am using terminal to print the result. In the subproject I removed all the GUI related files. And running through terminal. By doing so I am getting error while calling API itself.

    And for the main project I have used the 3rd party dynamically linked .so files.

    I have just copied the file to the by removing the headers and sources related to the GUI. But still it's not running.

    How do I link the .so file libraries from the main project to the subproject.

    Please let me know.
    Thanks in advance.

  • Lifetime Qt Champion

    The proper split would be to have one subproject that creates the library and then two others, one for the command line and one for the GUI that will link to that library.

  • Thank ou so much. It worked for me.

Log in to reply