Qt-creator使用dll

Qt-creator使用dll

问题描述:

如何在Qt中访问给定DLL中的函数?

How to access to functions in given DLL in Qt ?

您可以使用Qt类 QLibrary。您可以在 http://doc.trolltech.com/4.7/qlibrary中找到详细的描述和示例。 html

You can use the Qt class "QLibrary". You can find a detailed description and examples at http://doc.trolltech.com/4.7/qlibrary.html

主要思想是,您定义了一个函数指针,并使用QLibrary :: resolve将其分配给dll中的函数,然后您就可以通常将其称为任何函数。

The main idea is, that you define a function pointer, assign it with QLibrary::resolve to the function in the dll, and you can then call it normally as any function.