-1

I am brand-new with QT Creator, and someone else's project just fell into my lap, so please be kind.

I need to build an executable that can be emailed to and run upon other Windows machines that do not have QT Creator or its .dlls installed.

Curiously, invoking via the QT Creator IDE via the green triangle runs the application but double-clicking on the .exe does not. I see reports that certain .dlls, such as libwinpthread-1.dll, "do not exist on your computer" yet they are clearly present and the PATH includes routes to the containing folders.

Copying them into the folder containing the .exe has solved the problem but that is just a hack.

These problems persist even after running windeployqt.

Thanks!

  • What you're really asking is how to statically link your executable to all the libraries it requires. For Qt, you'll need both the Qt library statically linked, but also everything must be statically linked to the C++ runtime. There are multiple questions about this. – Kuba hasn't forgotten Monica Jul 04 '14 at 17:40

3 Answers3

0

If you are new to QT, it will be easier if you ship the needed libraries with your application. Put the qt/bin (e.g. C:\Qt\5.3\mingw482_32\bin) folder in your path and excecute windeployqt yourbiniary.exe from the cmd. That will copy all needed files to the folder of your application. That folder is then self-contained and can be distributed.

rbr
  • 433
  • 4
  • 10
0

I need to build an application that can be emailed to and run upon other Windows machines that do not have QT Creator installed upon them.

QT Creator doesn't need to be installed on target machines in order to run your application. As you have mentioned, you only need to provide the required dll files. This is the case for dynamic builds.

If you don't want to package the dlls with your application, you need to link against static Qt libraries. It means that you need a statically built Qt version. As far as i know, it is not found on the Qt website, hence, you need to build it yourself.

Murat Şeker
  • 1,651
  • 1
  • 16
  • 29
0

You should place Qt DLLs along the release version of your executable. These are Qt5Core.dll, Qt5Gui.dll and possibly the ones for other modules that you have used. These dll files are in your installed Qt Directory in bin folder.

You should also place msvcr100.dll and msvcp100.dll in case you are using MSVS2010.

If you are using plugins you should place their dll in a folder named plugins beside your exe. In case of using icons and images you should ship their dlls like qico.dll and qsvg.dll in a folder named imageformats.

Nejat
  • 31,784
  • 12
  • 106
  • 138