2

For full Story: someone has the exact same problem here: https://forum.qt.io/topic/50118/windows-qt-deployment-not-working-vs2010-qt-5-4-0

Short story and Question:

Is there anything Qt-Installer sets during the installation process of the SDK? My Application works only on machines where Qt is installed (C:/Program Files/Qt). I checked the env variables but there is nothing Qt related.

Any help appreciated.

user1767754
  • 23,311
  • 18
  • 141
  • 164
  • 1
    Yes, there are no these paths in your env. vars. But you can find these paths in your .exe and .dll files (in result of compilation for Windows). Usual Qt program knows full path to all Qt's .dll files on developer's computer. – Ilya Aug 20 '15 at 08:21
  • 1
    @Ilya you wrong. Program doesn't know. This path is stored in `Qt5Core.dll`. So only if `Qt5Core.dll` is resolved - then application knows a path on a developer machine. Otherwise - not. – Dmitry Sazonov Aug 20 '15 at 08:46
  • Is there a way of defining this path in qt5core.dll? And how can qt5core.dll know the path when its prebuild? – user1767754 Aug 20 '15 at 08:47
  • and will this explain, why an exe is not executed even though when all dll files are copied to the same directory? – user1767754 Aug 20 '15 at 08:50

3 Answers3

1

Well, there are two ways: the easy one, and the right one. The easy one is to copy all the dlls the application needs (i.e. all that appear in the error messages when you try to launch the app) to the same folder where your app's executable is. That should work, but that's ugly.

The right way is to make a static build of Qt, and use it to compile your application. The static application build this way will be portable as is - you will be able to launch it on any machine. The process of bilding a static version of Qt is described in the documentation here or here (basically it just requires compiling Qt with -static flag), and in some other SO questions

Community
  • 1
  • 1
SingerOfTheFall
  • 29,228
  • 8
  • 68
  • 105
1

Is there anything Qt-Installer sets during the installation process of the SDK?

Yes. During installation original path to Qt is hardcoded to QtXXX.dll's. So, in some cases, it is necessary to use qt.conf file.

Some links, to read more:

Reason of your problem

Official documentation for qt.conf

Deployment of Qt applications

Dmitry Sazonov
  • 8,801
  • 1
  • 35
  • 61
0

Qt (on Windows) installs its DLLs and adds the folder containing them to the PATH variable. You can provide the DLL binaries along with your application on the base of LGPL.

Melebius
  • 6,183
  • 4
  • 39
  • 52
  • i checked the PATH variable, there is no reference to Qt – user1767754 Aug 20 '15 at 06:50
  • Aren’t the DLL installed in an already-present folder like `Windows\System32`? Then the Qt installer wouldn’t need to touch `PATH`. I use Qt 4.8, they may have changed it since that version… – Melebius Aug 20 '15 at 06:53