How setenv before loading the dll file?
Unsolved
Qt 6
-
now that the program has to import the third dll files
and is there any possible that setenv path dynamiclly before the program started?
or setenv automatically ?Now I have to set the path varieties manually before the program started.If I moved the program file ,the sysmtem path cant work.So is there any good ideas?Os:windows 7 x86_64
Compile Tool:Mingw32 -
- start your program through a script (.bat file) which will set up all paths and environment variables
- if this is about third party libraries, you can load your app first, then set env using qputenv, then load your libs using QLibrary
- install libraries system-wide so that all apps will have access to them regardless of where they are
- compile your app statically to include all code inside
- create a launcher for your app which will set up QProcessEnvironment and then launch your main app through QProcess
As you can see, there are many ways to solve this. Which solution is correct depends on particular details of your situation and your preference.