Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to statically link a lib file into your QT project. Need help. Have questions:



  • Hi,

    Experimenting with creating a static library to link against a test program. Lets say I create a Factorial class with header and class files when I compile it (using MSVC compiler lets say in Windows) I get a lib file but QT Creator popsup a message that "executable not found". Not sure why thats happening.

    Second afterwards I create my test program widget QT doesn't autocomplete the header includer file. Maybe because path is wrong and I need header files besides not just the obj or dll files??

    So if anyone could please write up step by step instructions I would appreciate it.

    Thanks


  • Lifetime Qt Champion

    Hi @Davidm71,

    Experimenting with creating a static library to link against a test program. Lets say I create a Factorial class with header and class files when I compile it (using MSVC compiler lets say in Windows) I get a lib file but QT Creator popsup a message that "executable not found". Not sure why thats happening.

    Because a library is not an executable. Creator just tells you, that it cannot execute a lib.

    Second afterwards I create my test program widget QT doesn't autocomplete the header includer file. Maybe because path is wrong and I need header files besides not just the obj or dll files??

    Sure, you need the headers to compile and the lib to link against your library - no matter if you link static or dynamic.

    The usual way is to set up a SUBDIRS project to have lib and app together.

    Regards


Log in to reply