Home > Back-end > Released qt program how to separate dependent DLL under different directories
Released qt program how to separate dependent DLL under different directories
Time:12-11
QT program, exe executable and DLL files are in the same directory, I now want to put those DLLS, into a folder, the folder and exe in the same directory, so how should do?
Hope everyone passing by the great god gives directions
CodePudding user response:
1 lazy loading DLL, exe runs, use SetDllDirectory first, First 2 USES other exe start, set up the PATH
CodePudding user response:
In the main call SetDllDirectory
# include "mainwindow. H" #include H # include "Windows." Int main (int arg c, char * argv []) { QString s="./DB "; LPCWSTR path=s.t oStdWString (.) c_str (); SetDllDirectory (path);
QApplication a (arg c, argv); The MainWindow w; Baron how ();
Return a.e xec (); }
1 lazy loading DLL, exe runs, use SetDllDirectory first, 2 use other exe start, first set the PATH This is two kinds of method or a method of two steps? And how lazy loading DLL?