创建静态链接库lib
启动VS2010,文件、新建、项目、WIN32项目。 下一步,选静态库,完成。
添加新建项:factorial.h
输入代码:
#ifndef FACTORIAL_H
#define FACTORIAL_H
extern"C" __declspec(dllexport) int factorial(int n);
#endif
在stdafx.cpp添加该头文件,并定义factorial函数。
int factorial(int n)
{
return n;
}
编译生成factorial.lib文件。
作者:wuyuan
本文来自Wuyuan's Blog 转载请注明,谢谢!
文章地址: https://www.wuyuans.com/blog/detail/51