MinGw 生成Dll的连接库 无参数调用
2007-04-16 08:33
274 查看
pexports -o lua5.1.dll >lua5.1.def
dlltool -D lua5.1.dll -l lua5.1.a -d lua5.1.def
#include <stdio.h>
#include <malloc.h>
#include <assert.h>
typedef void (__stdcall *func_call)();
void __stdcall foo(int a,int b)
...{
printf("%d,%d ",a,b);
}
void check(void *arg)
...{
assert((void**)arg-&arg==1);
}
void test()
...{
int *arg=(int*)_alloca(2*sizeof(int));
arg[0]=1;
arg[1]=2;
check(arg);
((func_call)foo)();
}
void main()
...{
test();
}
dlltool -D lua5.1.dll -l lua5.1.a -d lua5.1.def
#include <stdio.h>
#include <malloc.h>
#include <assert.h>
typedef void (__stdcall *func_call)();
void __stdcall foo(int a,int b)
...{
printf("%d,%d ",a,b);
}
void check(void *arg)
...{
assert((void**)arg-&arg==1);
}
void test()
...{
int *arg=(int*)_alloca(2*sizeof(int));
arg[0]=1;
arg[1]=2;
check(arg);
((func_call)foo)();
}
void main()
...{
test();
}
相关文章推荐
- VC 调用 MinGW 生成的dll good
- c++调用matlab生成的Dll动态连接库
- PB调用SAP的Web Service结构体数组参数方法详解(使用C#调用Web Service生成dll)
- VC 调用 MinGW 生成的dll
- VC 调用 MinGW 生成的dll
- c++调用matlab生成的Dll动态连接库
- [2014.1.31] Eclipse、MinGW、JNI编写C++生成dll, Java端调用的完整示例(附java.lang.UnsatisfiedLinkError解决方法)
- c++调用matlab生成的Dll动态连接库
- 生成dll文件以及python对DLL中函数的调用(参数类型以及返回值)
- python中使用ctypes调用MinGW生成的动态链接库(dll)
- VC 调用 MinGW 生成的dll
- [2014.1.31] Eclipse、MinGW、JNI编写C++生成dll, Java端调用的完整示例(附java.lang.UnsatisfiedLinkError解决方法)
- Eclipse、MinGW、JNI编写C++生成dll, Java端调用的完整示例(附java.lang.UnsatisfiedLinkError解决方法)
- python中使用ctypes调用MinGW生成的动态链接库(dll)
- 【原创】PB调用SAP的Web Service结构体数组参数方法详解(使用C#调用Web Service生成dll)
- Eclipse、MinGW、JNI编写C++生成dll, Java端调用的完整示例(附java.lang.UnsatisfiedLinkError解决方法)
- c++调用matlab生成的Dll动态连接库
- C#调用ThoughtWorks.QRCode.dll生成带参数二维码
- C#调用C++生成的dll,参数有结构体数组
- C#调用C++dll 结构体参数传递问题