21.4 windows_21_Library_use_DLL 动态库补充4

windows_21_Library_use_DLL  动态库补充4

  1. #include <iostream>
  2. using namespace std;
  3. //第2.1.1步 导入 lib
  4. #pragma comment(lib,"../debug/windows_21_Library_DLL_test.lib")
  5. //第2.1.2步 定义函数原型
  6. int Dll_Add( int nAdd1, int nAdd2 );
  7. extern "C"/*如果不加这个会出错*/ int Dll_Sub( int nSub1, int nSub2 );
  8. //DEF导出定义函数原型
  9. int Dll_Mul( int nMul1, int nMul2 );
  10. int main( )
  11. {
  12. //第2.1.3步 使用函数
  13. int nAdd = Dll_Add( 100, 100 );
  14. int nSub = Dll_Sub( 100, 100 );
  15. int nMul = Dll_Mul( 100, 100 );
  16. cout << nAdd << endl << nSub << endl << nMul << endl;
  17. }





posted @ 2016-06-10 09:55  -刀狂剑痴-  阅读(170)  评论(0编辑  收藏  举报