1

I installed Qt 6.3.1 libraries pre-built with MinGW 11.2.0 64-bit using the online installer. The application crashes without entering the main function when I use any of Qt libraries in the Qt Creator while there is no problem if I use only C++ standart library. I guess the problem is in linking. Because I realized that there are .a files in the folder C:\Qt-mingw\6.3.1\mingw_64\lib, even though I am using Windows 10. Why are .a files installed instead of .lib files? How to solve this issue?

Here are the the selections that I made when installing Qt libraries using the online installer:

enter image description here

atakli
  • 128
  • 1
  • 9
  • 1
    Is there a reason to use mingw? Also, the extension might not play a role, there still might be coff formats. – Michael Chourdakis Jun 30 '22 at 18:32
  • 2
    The `.a` files might be for static linking. (Investigated into this out of curiosity just recently: [Problem while linking a static library during compilation in MinGW, why?](https://stackoverflow.com/q/72713796/7478597)) – Scheff's Cat Jun 30 '22 at 18:36
  • 2
    ***Why are .a files installed instead of .lib files?*** Because `.a` files are the correct extension for static libraries for gcc – drescherjm Jun 30 '22 at 18:47
  • 1
    Even if you are using dynamic libraries, GCC needs tiny static libraries that help load the dynamic libraries, and those usually have names ending with `.dll.a`. – David Grayson Jun 30 '22 at 19:19
  • I'm surprised that .lib/.a files can be either static libraries or import libraries (containing symbols to allow the linker to link to a DLL). I knew before that .a files are used in static linking in linux only. Thank you all. But my qt-mingw installation is still not working. [Here](https://forum.qt.io/post/631801) someone says that it may be due to duplication of some library. But haven't figured it out yet. @MichaelChourdakis Not yet but maybe in future. – atakli Jul 22 '22 at 07:39

1 Answers1

0

After learning that the problem may be due to duplication of some library from here, I saw using dependency walker that my program uses libstdc++-6.dll in system32 instead of qt-mingw installation. So the problem solved when I copied that dll into my app's folder. But I wonder how to solve this by changing the path without copying libstdc++-6.dll into app's folder. Because even though I put qt-mingw bin folder at the very beginning in system path, app uses still the one in system32.

atakli
  • 128
  • 1
  • 9