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 -
-
@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 -> Path
includes all the paths in os env varPath
, but for my old project is migrated from *nix os, and change os env varPath
doesn'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:
No. Once you changed the
PATH
for a project in Creator, the systemsPATH
no longer applies to this project, i.e. any change to the systemsPATH
have no effect for that project.ok, sophisticated.