关于Qt动态加载dll的问题
请高手为我解答下为什么我的加载是不成功的?#include<QtGui/QApplication>#include<QtGui/QWidget>#include<QLib...
请高手为我解答下为什么我的加载是不成功的?
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#include <QLibrary>
#include <Qt/qstring.h>
#include "PracDll.h"
typedef void (*my_SetupUi)(QWidget *);
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
#ifdef Q_OS_WIN
typedef void (*my_SetupUi)(QWidget *);
my_SetupUi test;
QString str = "PracDll.dll";
QLibrary lib(str);
test = (my_SetupUi)lib.resolve("setupUi");
QWidget *q = new QWidget();
test(q);
q->show();
lib.unload();
#endif
return app.exec();
} 展开
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#include <QLibrary>
#include <Qt/qstring.h>
#include "PracDll.h"
typedef void (*my_SetupUi)(QWidget *);
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
#ifdef Q_OS_WIN
typedef void (*my_SetupUi)(QWidget *);
my_SetupUi test;
QString str = "PracDll.dll";
QLibrary lib(str);
test = (my_SetupUi)lib.resolve("setupUi");
QWidget *q = new QWidget();
test(q);
q->show();
lib.unload();
#endif
return app.exec();
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询