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. Qmake (.pro) syntax question
Forum Updated to NodeBB v4.3 + New Features

Qmake (.pro) syntax question

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

    hi

    I'm looking for the option to build static library (Win32/64).
    current piece of PRO:
    TARGET = MyProject
    TEMPLATE = lib
    CONFIG += staticlib
    however the output is dll anyway.
    how can I fix this?

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      First, you must build Qt 5 itself as a static library. When you configure Qt, add the "-static" flag.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • A Offline
        A Offline
        amigo421
        wrote on last edited by
        #3

        I'm using qt creator for pure win32 app, without qt.
        so I don't see any qt references in my pro file and don't see where dll is specified

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          Ah, I see. I don't know the answer then, sorry.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • T3STYT Offline
            T3STYT Offline
            T3STY
            wrote on last edited by
            #5

            Try removing all qt related stuff with these:
            @CONFIG -= app_bundle
            CONFIG -= qt@
            However, by using the lib template and staticlib config it should get it done correctly. At least, it does for me. You may also want to try with CONFIG -= shared so to remove any option for building a shared library.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              amigo421
              wrote on last edited by
              #6

              I've removed generated Makefile, Makefile.Debug, Makefile.Release manually
              and rebuilt project and now it works correctly.

              Looks oddly for me - why "Clean" functionality doesn't do the same ? and I have to perform the cleaning manually ...

              1 Reply Last reply
              0
              • T3STYT Offline
                T3STYT Offline
                T3STY
                wrote on last edited by
                #7

                Sometimes it might be useful to manually run qmake (from the menubar: Build > Run qmake).
                Some changes in your .pro file might be overseen by qmake 8especially if they're made externally from Qt Creator), so the makefiles are not updated correctly. The clean step does not remove makefiles since it's qmake that handles them, so you may experience these little problems.

                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