Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QT6 run the .exe but point out "lack of libwinpthread-1.dll"
Forum Updated to NodeBB v4.3 + New Features

QT6 run the .exe but point out "lack of libwinpthread-1.dll"

Scheduled Pinned Locked Moved Solved Qt 6
6 Posts 4 Posters 1.1k 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.
  • pedisChenP Offline
    pedisChenP Offline
    pedisChen
    wrote on last edited by
    #1

    I have compile Qt6.5.3 Src file by Mingw and built a static link version QT.
    my configuration is :
    configure.bat -static -prefix "C:\Qt\6.5.3\mingw_64_static" -release

    and then I use the "mingw_64_static" to compile a program, got a “.exe” file. I attemped to run the .exe on another computer on win11.
    but it fails,system point out that “libwinpthread-1.dll” is missing.
    why? and how to solve it?Thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You did not use the -static-runtime option when calling configure.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      pedisChenP 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

        You did not use the -static-runtime option when calling configure.

        pedisChenP Offline
        pedisChenP Offline
        pedisChen
        wrote on last edited by
        #3

        @SGaist it works,but why? I followed the website instruction(https://doc.qt.io/qt-6.5/configure-options.html),there is no requirement to add the option -static-runtime,what is the relationship between them?

        jsulmJ 1 Reply Last reply
        0
        • pedisChenP pedisChen

          @SGaist it works,but why? I followed the website instruction(https://doc.qt.io/qt-6.5/configure-options.html),there is no requirement to add the option -static-runtime,what is the relationship between them?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @pedisChen said in QT6 run the .exe but point out "lack of libwinpthread-1.dll":

          but why?

          Because without -static-runtime runtime libs like pthread will not be built as static libs, instead they will be linked as shared libs.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          pedisChenP 1 Reply Last reply
          0
          • cristian-adamC Offline
            cristian-adamC Offline
            cristian-adam
            wrote on last edited by
            #5

            Have a look at this https://forum.qt.io/topic/156422/trying-to-build-a-static-qt-for-windows

            There @mzimmers tried to do exactly the same thing build a static Qt 6.5.3 with MinGW.

            1 Reply Last reply
            0
            • jsulmJ jsulm

              @pedisChen said in QT6 run the .exe but point out "lack of libwinpthread-1.dll":

              but why?

              Because without -static-runtime runtime libs like pthread will not be built as static libs, instead they will be linked as shared libs.

              pedisChenP Offline
              pedisChenP Offline
              pedisChen
              wrote on last edited by
              #6

              @jsulm I understand now,thank you

              1 Reply Last reply
              0
              • pedisChenP pedisChen has marked this topic as solved on

              • Login

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