开发者

Stand alone executable generation

开发者 https://www.devze.com 2023-04-10 06:23 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号