nmake编译dll
来源:互联网 发布:淘宝上刘雨晴 编辑:程序博客网 时间:2024/06/05 19:02
想弄nmake,百度上基础资料太少,都是linux的makefile,弄了2天才一点点效果
头痛中。。。
以下记录
//main.cpp
#include <iostream>
using namespace std;
//把Test.h改名为TestLib.h,并去掉_declspec(dllexport)
#include "TestLib.h"
#pragma comment(lib, "Test.lib")
int main()
{
cout<<"hello world"<<endl;
string curName;
Test t;
t.printName("wujingtao", curName);
int num = t.getNum();
string cnName = t.getCnName();
string usName = t.getUsName();
cout<<curName<<endl;
cout<<usName<<endl;
cout<<cnName<<endl;
cout<<num<<endl;
system("pause");
return 0;
};
//Test.h
#ifndef Test_H
#define Test_H
#include <string>
using std::string;
class _declspec(dllexport) Test
{
public:
string printName(const string& usName, string& cnName);
int getNum();
string getUsName();
string getCnName();
};
#endif
//Test.cpp
#include "Test.h"
string Test::printName(const string& usName, string& cnName)
{
string tmpName="";
if("wujingtao"== usName)
{
tmpName = "吴竞焘";
}
cnName = tmpName;
return tmpName;
}
int Test::getNum()
{
return 5;
}
string Test::getCnName()
{
return "吴竞焘";
}
string Test::getUsName()
{
return "wujingtao";
}
//makefile
all:main.obj Test.lib
link main.obj Test.libmain.obj:
cl /c /EHsc main.cpp
Test.lib:Test.obj
link /Dll Test.obj
Test.obj:Test.h
cl /c /EHsc Test.cpp
clean:
@del *.obj
@echo Project has clean
- nmake编译dll
- NMAKE命令行编译
- luasql编译 - nmake使用方法
- VS2010 nmake编译工程
- nmake编译openssl
- nmake && shapelib 编译
- nmake编译libtiff
- nmake命令行编译Qt项目
- windows下使用nmake编译
- NMAKE
- NMAKE
- nmake
- nmake
- vc中使用nmake命令编译方法
- VC中使用nmake命令编译方法
- vc中使用nmake命令编译方法
- nmake编译boost程序的脚本
- nmake、cmake、Visual Studio编译zlib
- PAT 1070. Mooncake (25)
- 删除数组零元素
- Struts2-创建登陆实例
- 五、如何修改m文件的打开方式?
- windbg定位死锁
- nmake编译dll
- uploadify在chrome下崩溃的解决方案
- 不知道有木有效果
- 把修改后的文件写回war包
- js 递归遍历对象、数组、属性
- Swift语法基础:14 - Swift的字符使用, 计算数量, 连接字符串和字符, 字符串插值, 比较字符串
- UNIX文件系统中各种文件、概念和函数之间的关系
- SSL 相关文章 理解整理
- JavaScript基础算法