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. Why do the MingW Qt DLLs have MSVCRT dependencies?

Why do the MingW Qt DLLs have MSVCRT dependencies?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.9k Views
  • 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
    mnbv
    wrote on last edited by
    #1

    Why do the MingW Qt DLLs have direct dependencies on msvcrt.dll? I have spent the last 18 hours trying to trace down an extremely nightmarish bug and signs are pointing more and more to incompatibilities between STL headers and STL objects exported from msvcrt.dll (manifesting themselves as the impossible-to-debug "The runtime has requested the application terminate in an unusual way" message boxes titled "Microsoft Visual C++ Runtime").

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mtrch
      wrote on last edited by
      #2

      MinGW uses msvcrt.dll as a C (not C++) runtime. MinGW C++ runtime is located in libstdc++6.dll

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        Executables built with MingW use the basic Microsoft C runtime, msvcrt.dll, found on every Windows machine. These are implementations of basic C library functions like malloc(), free(), fopen(), getenv() etc. There are also a few low-level C++ RTTI, exception and memory allocation related functions in that library.

        Most of the STL is templated code in headers but where functions are required they are found in the C++ runtime library. The Qt 4 bundled MingW's default behaviour is to statically link necessary parts of its C++ runtime (libstdc++) into your binary. I think the Qt5 bundled version uses dynamic linking (libstdc++-6.dll).

        You can clearly see what each DLL imports from msvcrt.dll using Dependency Walker.

        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