您的位置:首页 > 其它

21.4 windows_21_Library_use_DLL 动态库补充4

2016-06-10 09:55 393 查看
windows_21_Library_use_DLL 动态库补充4

#include <iostream>

using namespace std;


//第2.1.1步 导入 lib

#pragma comment(lib,"../debug/windows_21_Library_DLL_test.lib")


//第2.1.2步 定义函数原型

int Dll_Add( int nAdd1, int nAdd2 );

extern "C"/*如果不加这个会出错*/ int Dll_Sub( int nSub1, int nSub2 );


//DEF导出定义函数原型

int Dll_Mul( int nMul1, int nMul2 );


int main( )

{

//第2.1.3步 使用函数

int nAdd = Dll_Add( 100, 100 );

int nSub = Dll_Sub( 100, 100 );

int nMul = Dll_Mul( 100, 100 );


cout << nAdd << endl << nSub << endl << nMul << endl;

}

[/code]

来自为知笔记(Wiz)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: