方法一
新建一个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 on 2013-01-04 16:23
谢丛文 阅读(312)
评论(0) 编辑 收藏 引用