编写简单DLL及CL编译链接
来源:互联网 发布:360文件恢复软件下载 编辑:程序博客网 时间:2024/05/16 01:56
NO.1 使用DEF文件:
//dllsingle.h
#i nclude <windows.h>
INT APIENTRY add(int a,int b);
//dllsingle.cpp
#i nclude "dllsingle.h"
BOOL APIENTRY Entry()
{
return true;
}
INT APIENTRY add(int a,int b)
{
return a + b;
}
//dllsingle.def
LIBRARY dllsingle.dll
EXPORTS
add
//compile bat file
cl dllsingle.cpp dllsingle.def /link /out:dllsingle.dll /dll /Entry:Entry /OPT:NOWIN98 /machine:x86
del dllsingle.exp dllsingle.obj
pause
NO.2 不使用DEF文件
//dllsingle1.h
extern "C" _declspec(dllexport) int add(int a, int b);
//dllsingle.cpp
#i nclude "dllsingle1.h"
int Entry()
{
return 1;
}
int add(int a,int b)
{
return a + b;
}
//compile
cl dll2.cpp /link /out:dll2.dll /dll /Entry:Entry /OPT:NOWIN98 /machine:x86
del dll2.exp dll2.obj
pause
//dllsingle.h
#i nclude <windows.h>
INT APIENTRY add(int a,int b);
//dllsingle.cpp
#i nclude "dllsingle.h"
BOOL APIENTRY Entry()
{
return true;
}
INT APIENTRY add(int a,int b)
{
return a + b;
}
//dllsingle.def
LIBRARY dllsingle.dll
EXPORTS
add
//compile bat file
cl dllsingle.cpp dllsingle.def /link /out:dllsingle.dll /dll /Entry:Entry /OPT:NOWIN98 /machine:x86
del dllsingle.exp dllsingle.obj
pause
NO.2 不使用DEF文件
//dllsingle1.h
extern "C" _declspec(dllexport) int add(int a, int b);
//dllsingle.cpp
#i nclude "dllsingle1.h"
int Entry()
{
return 1;
}
int add(int a,int b)
{
return a + b;
}
//compile
cl dll2.cpp /link /out:dll2.dll /dll /Entry:Entry /OPT:NOWIN98 /machine:x86
del dll2.exp dll2.obj
pause
- 编写简单DLL及CL编译链接
- 命令行下cl.exe编译链接的问题及解决方法
- 在Windows下使用cl编译器编译生成简单的DLL例程
- cl命令行编译与链接子系统
- 编写DLL(动态链接库)的简单流程
- 动态链接库(DLL)的编写及导出函数
- VS2010编写动态链接库DLL及单元测试用例
- 程序的编译链接关系及库文件编写
- VS2010编写动态链接库DLL及单元测试用例,调用DLL测试正确性
- VS2010编写动态链接库DLL及单元测试用例,调用DLL测试正确性
- VS2010编写动态链接库DLL及单元测试用例,调用DLL测试正确性
- 编写.dll动态链接库
- 用cl与icl的编译生成.lib与.dll
- CL 编译
- DLL介绍及编写
- 为Symbian编写动态链接库DLL
- 为Symbian编写动态链接库DLL
- 为Symbian编写动态链接库DLL
- 同步加载数据岛数据
- MySQL日期时间函数大全
- 数据库的操作
- 多线程的实现
- 100个Java经典例子--初学者的利器高手的宝典JavaSE
- 编写简单DLL及CL编译链接
- oracle: ocp题解与实验(5/205)
- JavaScript 动态增加行~
- VC命令行编译
- 中国制造之痛:一部iPhone只赚4美元
- mysq中的l数据类型
- DOS遍历文件夹命令
- 赫夫曼树编码
- 翻页控件