您的位置:首页 > 其它

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();


}

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: