动态库编写

1.头文件-Dll1.h

#pragma once
//extern "C" __declspec(dllexport) int Sub(int a, int b);
#define dllExport __declspec(dllexport)
extern "C" dllExport int Sub(int a, int b);

或者

 

 或者

编写Source.def

LIBRARY exportDll2 //模块名
EXPORTS
    Add  //导出函数

2.调用

  2.1隐式链接

    1.配置头文件路径 库文件路径  lib文件

    2.

       

 

  2.2显示链接

    

 

     

 

posted @ 2022-01-07 15:05  磐正  阅读(78)  评论(0)    收藏  举报