目录
一、创建库
1、新建空项目
2、添加新文件
3、点击属性
4、设置
1、生成动态库
2、生成静态库
5、生成
6、库
生成动态库会得到
.dll
和.lib
文件
生成静态库会得到.lib
文件
二、使用库
1、新建测试项目
2、添加测试程序
3、使用库
1、添加附加包含目录
2、添加附加库目录
3、添加附加依赖库
4、添加测试代码
#include <iostream>
#include "add.h"
int main(int argc, char * argv[])
{
std::cout << "10+20=" << add(10, 20) << std::endl;
system("pause");
return EXIT_SUCCESS;
}