开发者

Static linking with a Qt project

I've got a Q开发者_开发百科t project I've built in Visual Studio 2010 Professional. However, when I run it (in either Debug or Release mode) it asks for a few Qt dll's. It works if I supply the dll's and throw them into System32, but my question is, how do I make it so that all libraries are included in the .exe? I have all of the static libraries I need, I just don't know how to make it so that the app doesn't ask the end user for them.


The correct way is to create a setup program that installs the Qt libraries along with your application. Visual Studio comes with a setup project template that you can use to create your own customized installer easily. Static linking is rarely a good option, for numerous reasons.

However, if you insist on static linking, you'll need to recompile the Qt sources with the -static flag.
A walkthrough is available here for Qt 4.

And if you're using the LGPL version of Qt, make sure you've read the answers to this question and appropriate addressed all legal concerns with your deployment.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜