How to make my Qt application load dlls in a different folder?
-
I have put all dependencies in the folder
D:\New folder
and added it under the user Environment Variables, is it correctly?I tested it, but it still complains about missing DLLs.
@Roberrt I was talking about PATH variable. I can't see it in your screen shot. And keep in mind: if you do it this way you will need to log off and on again.
-
@Roberrt I was talking about PATH variable. I can't see it in your screen shot. And keep in mind: if you do it this way you will need to log off and on again.
wrote on 10 Nov 2022, 12:46 last edited by Roberrt 11 Oct 2022, 12:49@jsulm said in How to make my Qt application load dlls in a different folder?:
PATH variable
To clarify, are you referring to
System Variables
>Path
variables?I've added the folder and rebooted, but now I'm getting this error:
This application failed to start because no Qt platform plugin could be initialized.
This is my dependencies folder:
-
@jsulm said in How to make my Qt application load dlls in a different folder?:
PATH variable
To clarify, are you referring to
System Variables
>Path
variables?I've added the folder and rebooted, but now I'm getting this error:
This application failed to start because no Qt platform plugin could be initialized.
This is my dependencies folder:
@Roberrt said in How to make my Qt application load dlls in a different folder?:
are you referring to System Variables > Path variables?
I'm referring to PATH environment variable.
You can set it in System Variables > Path variables. But as I already pointed out above: you need to log off and log in again after changing PATH. If it then still does not work then open a terminal and enter command "set" - check the value of the PATH variable there.
You should also consider that using paths with spaces can easily cause problems. -
@Roberrt said in How to make my Qt application load dlls in a different folder?:
are you referring to System Variables > Path variables?
I'm referring to PATH environment variable.
You can set it in System Variables > Path variables. But as I already pointed out above: you need to log off and log in again after changing PATH. If it then still does not work then open a terminal and enter command "set" - check the value of the PATH variable there.
You should also consider that using paths with spaces can easily cause problems.wrote on 10 Nov 2022, 13:31 last edited by@jsulm said in How to make my Qt application load dlls in a different folder?:
You should also consider that using paths with spaces can easily cause problems.
I modified it to a path without spaces, and rebooted, continue getting the same error message.
If i execute the exe inside of the DLL folder it works correctly.
I think the problem is these folders dont?
I used
windeployqt
to copy the dependencies, is it possible to 'copy' everything without creating any folder? -
@jsulm said in How to make my Qt application load dlls in a different folder?:
You should also consider that using paths with spaces can easily cause problems.
I modified it to a path without spaces, and rebooted, continue getting the same error message.
If i execute the exe inside of the DLL folder it works correctly.
I think the problem is these folders dont?
I used
windeployqt
to copy the dependencies, is it possible to 'copy' everything without creating any folder?@Roberrt What about my suggestion from above: "If it then still does not work then open a terminal and enter command "set" - check the value of the PATH variable there.". If the PATH is set correctly try to start your app from a terminal - does that work?
-
@jsulm yes, when i enter "set" in the terminal i can see the path.
I tried launching the app using the terminal it gave the same error.
@Roberrt Can you show your PATH?
-
@Roberrt If c:\Users\Public\Qt is the folder with your libs it should work.
You also tried to use qt.conf: did you specify the folder with the libs using "Libraries = PAT_TO_LIBS_FOLDER"? Prefix is the app folder. -
@Roberrt If c:\Users\Public\Qt is the folder with your libs it should work.
You also tried to use qt.conf: did you specify the folder with the libs using "Libraries = PAT_TO_LIBS_FOLDER"? Prefix is the app folder.wrote on 10 Nov 2022, 19:48 last edited by Roberrt 11 Oct 2022, 20:40@jsulm
I got it working for a new project containing just a push button, I also needed to create a variable with the nameQT_PLUGIN_PATH
under the System variables environment, and set the folder which contains these plugins folders (platforms, etc), in my caseC:\Users\Public\Qt
.But for my app using
qwebengine
its not working, when i run the exe i don't see any error message neither my gui, then it closes :(
13/13