cl编译得到的dll无法通过rundll32.exe调用

源程序(两个):

test.def:

EXPORTS add

test.c:

#include <stdio.h>

extern int add(){
 printf("hello world\n");
 return 0;
}

编译

cl test.c test.def /LD

运行

rundll32 test.dll,add

但并没有printf我所期待的结果:

C:\Users\zh199\Documents\Z_Sth\c>rundll32 test.dll,add

C:\Users\zh199\Documents\Z_Sth\c>

如何解决?

阅读 2.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进