Deploying .exe file on different computer
-
Hi guys:
I knew .exe built by Qt that if we need to deploy to other computers, we also need to pack some dll file(QtCore... etc). How do I make my application to find the dlls that is not in current folder? it means wherever my application is located, my application always can find dll in the same path and run perfectly. I refer the document which link is follows:
http://qt-project.org/doc/qt-4.8/deployment-windows.htmlBut it's not work.The simple code look like these:
@
QApplication a(argc, argv);
a.addLibraryPath("C:\Windows\Qtdll");
MainWindow w;
w.show();
@
Thanks in advance for reply. -
Hi,
You don't need addLibraryPath().
What version of Qt are you using? Follow the tutorial at http://qt-project.org/wiki/Deploy_an_Application_on_Windows (It's written for Qt 5, but the steps are similar for Qt 4 too)
-
Hi, there's a "good guide here":http://qt-project.org/wiki/Deploy_an_Application_on_Windows
Also I posted in my blog on "how to deploy":http://www.tripleboot.org/?p=138 and "why deploying this way":http://www.tripleboot.org/?p=536
addLibraryPath needs to be called before QApplication a(argc, argv); it has no effect for normal DLLs like Qt5Core.dll, Qt5Gui.dll, but you can read more about it :-)
-
Thanks you, guys:)). Finally I used "Inno Setup5" to deploy the dll from qt.