摘要: 1、VS2003新建DLL项目dllTest2、项目dllTest中添加脚本lib.h,代码如下:1 //lib.h2 #ifndef LIB_H3 #define LIB_H4 extern "C" int add(int x,int y);5 extern "C" int mius(int x,int y);6 #endif 3、项目dllTest中添加脚本lib.cpp,代码如下: 1 //lib.cpp 2 #include "lib.h" 3 int add(int x,int y) 4 { 5 return x + y; 阅读全文
posted @ 2013-10-24 15:07 Faint@LastStep 阅读(549) 评论(0) 推荐(0) 编辑
摘要: 1、VS2003新建DLL项目dllTest2、项目dllTest中添加脚本lib.h,代码如下:1 //lib.h2 #ifndef LIB_H3 #define LIB_H4 extern "C" int __declspec(dllexport) add(int x,int y);5 extern "C" int __declspec(dllexport) mius(int x,int y);6 #endif 3、项目dllTest中添加脚本lib.cpp,代码如下:1 #include "lib.h"2 int add(int 阅读全文
posted @ 2013-10-24 13:51 Faint@LastStep 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 1、VS2003新建Static DLL项目libTest2、项目libTest中添加脚本lib.h,代码如下:1 //lib.h2 #ifndef LIB_H3 #define LIB_H4 extern "C" int add(int x,int y);5 extern "C" int mius(int x,int y);6 #endif3、项目libTest中添加脚本lib.cpp,代码如下: 1 //lib.cpp 2 #include "lib.h" 3 int add(int x,int y) 4 { 5 return x 阅读全文
posted @ 2013-10-24 13:19 Faint@LastStep 阅读(229) 评论(0) 推荐(0) 编辑