开发者

Qt non-static linking and .pro files

I am trying to build a .dll that uses the QtCore4 and QtGui4 .dll files. However, I want both Qt .dll files to be linked non-statically. I have read a lot about .pro files and static linking but no one seems to talk about dynamic linking with Qt .dll's. How do I开发者_运维知识库 ensure that the qt dlls are built for dynamic linking?

I am having problems that there seems to be two instances of the dll's in my app, one in the app that uses my dll, and then one for the dll itself, so when I try and get a window handle the code inside my dll can't 'see' it; disjoint qtwidget sets is the phrase often used.

Any suggestions?


Unless you added the keyword 'static' to your configuration parameters, the Qt libraries should be already building as dynamic link libraries. That is the default configuration.


The dll extension means Dynamically Linked Library. This means that if you compile the library as a dll, it will always be suitable for dynamic linking.

(If you build a library for statical linking, that has a different extension and requires different config.)

In Qt projects, dynamic linking is the default option. You don't need to do anything to achieve it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜