can't find dll when debug/run in QtCreator
-
both methods don't work
- projects -> Build & Run -> Run -> Run Environment -> append dll dir paths to variable "Path"
- add dll dir paths to system environment "Path"
env
- os: win10
- kit: MSVC2017
- Qt: 5.12.0
- QtCreator: 4.8.0
BTW, if copy the dll to the dir where the executable is, it works.
-
solved
The first method works, my mistake to not include enough path, QtCreator ignores all os environment variable "Path".BTW, it seems that dll can be specified in .pro file:
https://wiki.qt.io/How_to_link_to_a_dll -
solved
The first method works, my mistake to not include enough path, QtCreator ignores all os environment variable "Path".BTW, it seems that dll can be specified in .pro file:
https://wiki.qt.io/How_to_link_to_a_dll -
QtCreator ignores all os environment variable "Path".
It does not - I use it this way (I have a directory c:\dlls). But you have to restart all programs after such a change in order to take effect.
@aha_1980 said in can't find dll when debug/run in QtCreator:
QtCreator ignores all os environment variable "Path".
It does not - I use it this way (I have a directory c:\dlls). But you have to restart all programs after such a change in order to take effect.
I created a new project,
projects -> Build & Run -> Run -> Run Environment -> Pathincludes all the paths in os env varPath, but for my old project is migrated from *nix os, and change os env varPathdoesn't take effects. It seesm that QtCreator only find dlls inprojects -> Build & Run -> Run -> Run Environment -> Path -
@aha_1980 said in can't find dll when debug/run in QtCreator:
QtCreator ignores all os environment variable "Path".
It does not - I use it this way (I have a directory c:\dlls). But you have to restart all programs after such a change in order to take effect.
I created a new project,
projects -> Build & Run -> Run -> Run Environment -> Pathincludes all the paths in os env varPath, but for my old project is migrated from *nix os, and change os env varPathdoesn't take effects. It seesm that QtCreator only find dlls inprojects -> Build & Run -> Run -> Run Environment -> Path -
@jronald Well, if you change the
PATHthere, the systemPATHis overwritten. But that is to expect, isn't it? -
@aha_1980 that's ok, it means when the project has been created, changing os env var
Pathwill not take effect any more. -
No. Once you changed the
PATHfor a project in Creator, the systemsPATHno longer applies to this project, i.e. any change to the systemsPATHhave no effect for that project.@aha_1980 said in can't find dll when debug/run in QtCreator:
No. Once you changed the
PATHfor a project in Creator, the systemsPATHno longer applies to this project, i.e. any change to the systemsPATHhave no effect for that project.ok, sophisticated.