1.将.h .lib .dll 的第三方文件复制到项目文件夹下

2.将.dll复制到输出目录exe目录下

3.在项目属性里添加lib文件路径

4.调用
#include"dll5/hello.h"
#include <iostream>
#pragma comment(lib,"QtWidgetsApplication2.lib")
using namespace std;
int main(int argc, char* argv[])
{
Face2* Fa = Face2::CreateFace2();
Fa->main2(argc, argv);
Fa->main2(argc, argv);
Fa->Init2();
cout << Fa->InitAdd2(5, 6) << endl;
return 0;
}
cpp文件中
#include"dll5/hello.h"
#include <iostream>
#pragma comment(lib,"QtWidgetsApplication2.lib")
using namespace std;
int main(int argc, char* argv[])
{
Face2* Fa = Face2::CreateFace2();
Fa->main2(argc, argv);
Fa->main2(argc, argv);
Fa->Init2();
cout << Fa->InitAdd2(5, 6) << endl;
return 0;
}
本文介绍如何在项目中集成并调用第三方DLL文件,包括复制必要的.h,.lib,.dll文件,设置输出目录,配置项目属性及在cpp文件中进行调用的具体步骤。

600

被折叠的 条评论
为什么被折叠?



