首页 > 代码库 > 动态链接库DLL
动态链接库DLL
静态链接库的使用方法:
示例代码:http://pan.baidu.com/s/1i303qZV
1.创建工程
2.向工程中添加.cpp 和.h
3.头文件代码
#ifdef MyDLL_API #else#define MyDLL_API _declspec(dllexport)#endifMyDLL_API int Add(int a,int b);MyDLL_API int Sub(int a,int b);
4.CPP中的代码
#define MyDLL_API _declspec(dllexport)#include "DLL.h"int Add(int a,int b){ return a+b;} int Sub(int a,int b){ return a-b;}
静态链接库的调用:
1.讲.DLL .LIB .H 复制到工程目录下
2.工程--设置--链接 将.lib文件添加到链接中 多个用空格隔开
3.添加头文件
4.直接使用方法
动态链接库DLL
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。