Stand alone executable generation
I would like to create a stand alone executable for a Qt based visual c++ project. I have compressed the executable file in the 开发者_如何学运维debug directory and the dependencies together. I tried to start this application in another computer which doesn't has Qt. But it results in error, saying "cannot find Qtcore4.dll" even though it is available in the compressed file.
What is the other possible way to create the stand alone executable?
To create a standalone executable which does not require to have Qt4 installed, you have to compile your application statically. In your project options, in Visual Studio, there should be an option that would allow you to actually do just that. If you don't link statically, which is generally the default behavior, the executable tries to get the Qt library installed in the OS.
Note that your executable will be much larger as you will embed important part of the Qt library.
精彩评论