Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Create *.lib instead of *.a
Forum Updated to NodeBB v4.3 + New Features

Create *.lib instead of *.a

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 3 Posters 4.9k 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.
  • K Offline
    K Offline
    keresan
    wrote on last edited by
    #1

    hi,
    i have read tons of articles about how to make a static library in qt on windows. but i am confused how to make *.lib

    i have included to *.pro file 2 lines:
    TEMPLATE = lib
    CONFIG += staticlib

    everything is fine, but when i compiled it, it makes only *.a library. and i need *.lib

    can you tell me, what i doing wrong ?? i need *.lib library, because when i have *.a lib, i have to include library as well as its headers files to .pro file. i thing, this is impractical.

    thanks for any advice

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lycis
      wrote on last edited by
      #2

      Actually I think that a .a file created by MinGw should be compatible to a Visual C++ compiler. So I assume you could use the .a like any other static library (.lib) created by a Visual C++ compiler and link it in your project.

      If this proves to be wrong try compiling your library with a Visual C++ compiler as that should usually result in a .lib file.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        keresan
        wrote on last edited by
        #3

        okej, thanks, i think i will use *.a lib.

        another question:
        i have about 10 clases and about 10 header files, is there any possibility to create static library with only one header file?

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lycis
          wrote on last edited by
          #4

          I assume you could cramp all your definitions in one header file but that's really messy and quite not usable for other programmers (and in fact will prove not suitable in time for your self). What I usually do is providing one "entry point" header file that includes all other files that are necessary for accessing the libraries function.

          Of course you'd still have to deploy all header files to the project that is using your library but I think its a reasonable effort to do and using your library will get easier when you provide a "one for all" header file.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aabc
            wrote on last edited by
            #5

            You dont need to do bq. CONFIG += staticlib

            bq.

            The default is .lib

            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