在Qt应用程序中使用自定义dll [英] Using custom dll in Qt Application
本文介绍了在Qt应用程序中使用自定义dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
首先,我的编译器和操作系统为:
First, my compiler and OS:
- Qt Creator 1.3
- Qt 4.6(32位)
- Windows 7 Ultimate
我想学习如何创建和导入dll在Qt中我使用Qt Creator创建了一个 *。dll
文件,名为 Shared1.dll
,其中只包含一个空类名为 Shared1
。现在,我想在另一个Qt项目中使用 Shared1
类。我该怎么办?
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?
预先感谢。
推荐答案
使用Pro文件包含头文件和库。.
Use your Pro file to include your header files and libraries..
对于头文件:
INCLUDEPATH += "C:\Source\HeaderFiles"
对于库:
LIBS += "C:\Source\Libraries\MyLib.lib"
在使用库中的函数时包括这些头文件。
Include those header files while using the functions from the libraries.
此对我有用...试试吧..
This works for me... Try it..
这篇关于在Qt应用程序中使用自定义dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文