5
votes

I have ported an existing Qt4 application Qt5 and added some extra (simple) functionality to this application.

The old application came with

  • libgcc_s_dw2_1.dll
  • libusb-1.0.dll
  • mingwm10.dll
  • QtCore4.dll
  • QtCored4.dll
  • QtGui.dll

Now, from QtCreator I am able to run my modified application, but problems occur when preparing deployment. I have used dependancy walker on my .exe and included a load of DLL's in my executables directory.

  • icudt51.dll
  • icuin51.dll
  • icuuc51.dll
  • IEShims.dll
  • libgcc_s_dw2-1.dll
  • libGLESv2.dll
  • libstdc++-6.dll
  • libusb-1.0.dll
  • libwinpthread-1.dll
  • mingwm10.dll
  • Qt5Core.dll
  • Qt5Cored.dll
  • Qt5Gui.dll
  • Qt5Guid.dll
  • Qt5Widgets.dll
  • Qt5Widgetsd.dll
  • QtCored4.dll

(Yes, the project size is now extremely large due to the DLL's, but in my use case this is not an issue.)

And finally it didn't complain about missing DLL's. The error message posted when trying to execute the .exe is:

The procedure entry point ?testBit@QBitArray@@QBE_NH@Z could not be located in the dynamic link library Qt5Core.dll

I have never tried executing a Qt application outside Qt Creator, so I have really no idea what to do.

If it helps: Under Projects-> qmake build config : Release -> Effective qmake call I have

qmake.exe D:\Product\test_util.pro -r -spec win32-g++

If any more information is required to make anything more clear, please leave a comment about it.

1
You include both debug and release versions of Qt dlls. However you can have only one of them, depending on your configuration. This will strip down your package size.vahancho
@vahancho oh, so that's what the d suffix means. Thank youchwi
Are you sure that the DLL version matches the binary being built? i.e. there are different dlls for Qt 5 and Qt 5.1.laurent
@returnthis.lau_ I use the DLL's from the Qt installation I have, i.e Qt5.2chwi
reason # 233 to hate QT LOL what an ide where cant build application for distribution :Duser889030

1 Answers

3
votes

I had the same problem on Qt 5.4.2 after slightly modifying my code to add new functionality depending on OpenGL. What I did was use Qt's Window's Deployment tool.

  1. Create a folder and place your binary in it
  2. Using cmd issue the following command depending on which version of binary you have:
    • windeployqt --release Name_Of_Binary
    • windeployqt --debug Name_Of_Binary

Depending on which version of Qt Creator you have, you might have to manually copy the lib*.dll's to the directory. This bug is not present in Qt 5.4.2 but was present in earlier versions.