我的个人博客:张0 Peter的个人博客
1 .工具介绍Windows工具包附带的编译器如下:
cl.exe :编译器link.exe :链接器link.exe :加载lib库的程序nmake.exe :如何在makefile中构建、编译工具2.cl我使用的是VS2017 打开命令行窗口,我选择的是64位编译工具
使用以下命令显示cl的参数:
cl -help
写最简单的程序:
#includeiostreamintmain(void ) STD : cout ' thisisanativecprogram.' STD :3360 endl; STD : cout ' hello world.' STD :3360 endl; 返回0; }切换到代码目录,编译并运行:
3 .创建Makefile和使用nmake创建windows nmake所需的Makefile与gcc中的Makefile创建有很多不同。 具体来说,你可以进入微软的官方网站看教程。
写化妆文件:
# specifycompilercc=cl.exe.phony : allall : hello-world.exe hello-world.exe : hello-world.CPP $ (cc )
执行完毕
参考资料:
samplemakefilehowtousenmakeandmakefile