A 32-bit Qt application on win 7 x64 will not work, but works fine with Qt Creator?

My development window is Windows 7 x64. I have the 32-bit and 64-bit versions of Qt 4.7.4 built on my box. When I configure the application to use the 32-bit version of Qt, it works fine in Qt Creator (ctrl-R), but when I try to double-click EXE in Windows Explorer (or run from the command line), I get

  ---------------------------
 RenameTemplatePreviewFiles_Qt_win.exe - Application Error
 ---------------------------
 The application was unable to start correctly (0xc000007b). 
 Click OK to close the application. 
 ---------------------------
 Ok   
 ---------------------------

If I switch my configuration to 64-bit Qt and build it, I can double-click the EXE and it works fine.

What do I need to do to run exe compiled with 32-bit Qt?

+6
source share
3 answers

My somewhat educated assumption is that your application may simply not find the required DLLs. Of course, you can open your exe in Dependency Walker to see if it finds all the necessary DLLs. If nothing happens at first, first use Dependency Walker to profile the application. This may reveal some missing dependencies loaded at runtime.

If this is related to your Qt DLLs, make sure that your PATH environment variable has a corresponding entry or that the necessary DLL files are included in your EXE directory (although the latter may not be the best choice for a development machine).

+5
source

Just add the three missing dll files:

  • libwinpthread-1.dll
  • libstdc ++ - 6.dll
  • libgcc_s_dw2-1.dll

to appl.exe folder. For my system, this will be in the C:\Users\H\Documents\build-AQtest01v4-Desktop_Qt_5_11_0_MSVC2017_64bit-Debug . Copying these libraries should make your application work. On my system, these dlls can be found in C:\Qt\Tools\mingw492_32\bin .

0
source

I ran into the same problem. First, I copied the necessary DLL files to the release folder, where my EXE file exists. Then I copied the optional libstdc ++ - 6.dll file. The program started working after that.

0
source

All Articles