2

Now I have such structure of my app files:

-myApp.exe
-Qt5Core.dll
-Qt5Gui.dll
-Qt5Widgets.dll
-platforms
|-qwindows.dll

Is it possible to put all dlls into one folder:

-myApp.exe
-libs
|-Qt5Core.dll
|-Qt5Gui.dll
|-Qt5Widgets.dll
|-platforms
||-qwindows.dll

I know I can build Qt statically and run apps without any dlls at all but I want to keep them, just put into one folder

4

1 回答 1

5

Is it possible to put all dlls into one folder:

Yes, sure. You need to set up the dedicated folder properly so that the application can find the libraries. You can add that folder to the PATH for instance.

Basically, as per official MSDN documentation, this is the order how Windows tries to locate a DLL:

  • The directory where the executable module for the current process is located.

  • The current directory.

  • The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.

  • The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.

  • The directories listed in the PATH environment variable.

于 2013-12-19T12:43:35.233 回答