I have written a simple dialog using Qt library on Widows 7. Now I need to send that .exe
file to my friend so he could use that. But I need to send about 10 .dll
files too so he could use it. I have found all them and sent, but he cannot open it. There is some "Visual C++ Runtime Error". Frankly speeking, in my other computer I can not open it either with the same error. I have googled a lot, and have found different answer such as:
But all this does not help me. So my questions are:
.dll
stuff buy compiling it into one .exe
file easily?In Build Settings uncheck Shadow build (this will make sure that the release folder is inside of your project directory instead of outside of your project directory). Build and run you project(This will create a release directory inside of yours project folder). Copy *. dll and *.exe file from C:\Qt\6.3.
0 The simplest way to use windeployqt is to add the bin directory of your Qt installation (e.g. <QT_DIR\bin>) to the PATH variable and then run: windeployqt <path-to-app-binary> If ICU, etc. are not in the bin directory, they need to be in the PATH variable.
1.Why it works on my computer where I have developed that dialog, i.e. what is the problem?
Because you have VC Runtime installed on your computer.
There are two ways to solve this problem,
a.you need to compile QT and your exe with MultiThread(MT) instead of MultiThreadDLL(MTD).
b.install vc runtime on your friend's computer.
2.How can I get rid of all that .dll stuff buy compiling it into one .exe file easily?
You have to build all the QT dlls in to libs (whit MT), and link your exe with those libs.
It's time consuming. And you will still need windows dlls. Anyway, if you still want to link Qt statically these links may be very useful:
This links help me to find the solution. https://bugreports.qt-project.org/browse/QTBUG-28766
I was copy all the dll inside "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin" directory but all solved after add the "platforms/qminimal.dll" and "platforms/qwindows.dll" to my .exe program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With