Using custom dll in Qt Application

牧云@^-^@ 提交于 2019-12-24 01:16:33

问题


First, my compiler and OS:

  • Qt Creator 1.3
  • Qt 4.6 (32 bit)
  • Windows 7 Ultimate

I want to learn how to create and import a dll in Qt. I've created a *.dll file using Qt Creator, called Shared1.dll which contains nothing but an empty class named Shared1. Now I'd like to use Shared1 class in another Qt project. How can I do that?

Thanks in advance.


回答1:


Use your Pro file to include your header files and libraries..

For Header Files:

INCLUDEPATH += "C:\Source\HeaderFiles"

For libraries:

LIBS += "C:\Source\Libraries\MyLib.lib"

Include those header files while using the functions from the libraries.

This works for me... Try it..



来源:https://stackoverflow.com/questions/2790611/using-custom-dll-in-qt-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!