16,199
社区成员
发帖
与我相关
我的任务
分享
#ifndef QTDLL_H
#define QTDLL_H
#include "qtdll_global.h"
class QTDLLSHARED_EXPORT Qtdll
{
public:
Qtdll();
void helloWorld(); // 添加一个函数
};
#endif // QTDLL_H
#include "qtdll.h"
#include <iostream>
Qtdll::Qtdll()
{
std::cout << "qtdll construct" << std::endl;
}
void Qtdll::helloWorld()
{
std::cout << "hello world" << std::endl;
}
INCLUDEPATH += "C:/Users/Mali Ang/Desktop/Graduating/QT_Projects/qtdll"
LIBS += -L"C:/Users/Mali Ang/Desktop/Graduating/QT_Projects/build-qtdll-Desktop-Debug/debug/qtdll.lib"
#include <QCoreApplication>
#include "qtdll.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Qtdll m; //
m.helloWorld(); // 调用dll里面的函数
return a.exec();
}