Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to create a .lib static library using QtCreator with the mingw compiler
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 10.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mcintks
    wrote on last edited by
    #1

    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?

    Keith

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jake007
      wrote on last edited by
      #2

      .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


      Code is poetry

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mcintks
        wrote on last edited by
        #3

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

        Keith

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          [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?

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcintks
            wrote on last edited by
            #5

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

            Keith

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcintks
              wrote on last edited by
              #6

              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.

              Keith

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved