posts - 1,  comments - 0,  trackbacks - 0
  2013年1月4日
方法一
 新建一个Console application
   建立两个文件 dll.h 和 dll.cpp
  dll.h
 ================
     int add(int ,int);

dll.cpp
在函数前面 extern "C" __declspec(dllexport)
 =================

extern "C" __declspec(dllexport)
int add(int x,int y)
{
   return x+y;
}

在project=》setting=》link 最下面的 project options中 最后 添加 /dll

方法二
  使用def文件
新建一个Console application
   建立两个文件 dll.h 和 dll.cpp
  dll.h
 ================
     int add(int ,int);

dll.cpp 
=================
int add(int x,int y)
{
   return x+y;
}

建立一个def文件
内容为:
LIBRARY (可能不需要)
EXPORTS
add

在project=》setting=》link 最下面的 project options中 最后 添加 /dll


posted @ 2013-01-04 16:23 谢丛文 阅读(311) | 评论 (0)编辑 收藏
仅列出标题  
<2026年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿

随笔档案

搜索

  •  

最新评论