作者:小白救星
编译:gcc -c -DBUILDING_HZ_DLL1 hzdll1.c
           gcc -shared -o hzdll1.dll hzdll1.o -Wl,--kill-at,--out-implib,hzdll1.a
           或:gcc -shared -o hzdll1.dll hzdll1.o -Wl,--kill-at,--out-implib,hzdll1.lib
查看dll中的函数:dumpbin -exports hzdll1.dll

hzdll1.c

#include <stdio.h>
#include "hzdll1.h" __stdcall void hello(const char *s)
//void hello(const char *s)
{
printf("Hello %s\n", s);
} int Double(int x)
{
return * x;
}

hzdll1.h

#ifndef HZ_DLL1_H
#define HZ_DLL1_H #ifdef __cplusplus
extern "C" {
#endif #ifdef BUILDING_HZ_DLL1
#define HZ_DLL1 __declspec(dllexport)
#else
#define HZ_DLL1 __declspec(dllimport)
#endif void __stdcall HZ_DLL1 hello(const char *s);
//void HZ_DLL1 hello(const char *s); int HZ_DLL1 Double(int x); #ifdef __cplusplus
}
#endif #endif // HZ_DLL1_H

最新文章

  1. PostgreSQL 允许远程访问设置方法
  2. 移动端click事件延迟300ms问题
  3. 运行tomcat8w.exe未安装指定的服务
  4. Eclipse里面Outline中图标的含义
  5. MFC CEdit改变字体大小的方法
  6. AngularJS中实现无限级联动菜单
  7. android开子线程避免出现main错误
  8. Mysql的常用用法
  9. 《30天自制操作系统》10_day_学习笔记
  10. 修改idea的运行内存
  11. 离线文档(DocSet)下载地址汇总
  12. 在webservice中传递Hashtable
  13. SSH调试
  14. 搭建eureka服务
  15. 待解决ava.lang.OutOfMemoryError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method)
  16. NowCoder--牛客练习赛30 C_小K的疑惑
  17. 【BZOJ1802】[AHOI2009]checker(动态规划)
  18. linux常用命令:shutdown 命令
  19. linux平台关闭某个进程的脚本
  20. Add custom daemon on Linux System

热门文章

  1. denyhost安装脚本
  2. dj 模型层orm-1
  3. java术语(PO/POJO/VO/BO/DAO/DTO)
  4. html的那些小小细节
  5. ckeditor粘帖上传图片控件-更新-2.0.15版本
  6. Path类对路径字符串的操作
  7. (简单广搜) Ice Cave -- codeforces -- 540C
  8. 将电脑信息上传到中国移动ONENET平台
  9. JavaScript相关基础知识点
  10. java类与继承(转载)