链接win32 dll在Qt [英] Linking win32 dll in Qt

查看:131
本文介绍了链接win32 dll在Qt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的Qt应用程序引用一个win32 dll。我已经将.ll文件中的dll位置添加到LIBS + =。一旦这样做,通过正确的,我应该能够将.h文件包含在我的应用程序的dll内。但我不能这样做。
我正在使用dll进行测试: http://www.flipcode.com /archives/Creating_And_Using_DLLs.shtml



任何帮助将不胜感激!



谢谢

解决方案

我想你也必须添加INCLUDEPATH + = path_to_library_headers到你的pro文件。 LIBS + =仅告诉链接器某些符号不在您的应用程序代码中,但在外部DLL中,但是您必须告诉编译器应该在哪里找到库头。



希望这有帮助。如果您还有其他问题,请发布链接器/编译器错误消息,这将更容易得出错误。


I want to reference a win32 dll from my Qt application. I've added the dll location in the .pro file at "LIBS+=" . Once that is done, by right, i should be able to include the .h file inside the dll from my application. But i'm unable to do so. I'm testing with the dll here: http://www.flipcode.com/archives/Creating_And_Using_DLLs.shtml

Any help would be appreciated!

Thanks

解决方案

I suppose you also have to add "INCLUDEPATH += path_to_library_headers" to your pro file. "LIBS+=" only tells the linker that some symbols are not in your application code, but in external dll, but you have to tell the compiler where it should look for the library headers.

Hope this helps. If you have any more problems, post the linker/compiler error messages, it would be much easier to tell what's wrong.

这篇关于链接win32 dll在Qt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆