How to create a .lib static library using QtCreator with the mingw compiler



  • I am trying to create a static library .lib file. With this .pro file, I get only a .a file as the result.

    QT -= gui

    TARGET = mystaticLib
    VERSION = 0.1
    TEMPLATE = lib
    CONFIG += staticlib
    SOURCES +=
    staticlibsource.cpp
    HEADERS +=
    staticlibsource.h

    What am I doing wrong? Is it possible with this configuration?



  • .a is a valid mingw library file ( use it as .lib).
    If you want .lib, you'll need to use MS VS compiler.

    Regards,
    Jake



  • Thanks. I guess I need to install Qt with a different compiler.


  • Moderators

    [quote author="mcintks" date="1332160727"]Thanks. I guess I need to install Qt with a different compiler. [/quote]
    That seems to be odd. Why do you rely so much on a name convention?



  • pardon my ignorance. I have to convince the application developer that the .lib lib will work.



  • The application developer states that my library needs to have been build with the msvc compiler, not the mingw compiler. That is what is meant by the need to generate a .lib static library. I guess I need to somehow add the msvc compler to the tool chain or rebuild qt with the msvc compiler.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.