visual c++ build tools的安装与使用
開發(fā)環(huán)境:
win10 + Microsoft Visual C++ Build Tools 2015
-----------------------------------------------------------------
?
The Microsoft Visual C++ Build Tools installs only the command-line compiler, tools, and libraries you need to build C and C++ programs. It's perfect for build labs or classroom exercises and installs relatively quickly. To install only the command-line tools, download and install?Microsoft Visual C++ Build Tools 2015.
?
The following tools can help you to build a C/C++ project on the command line.
1. CL
Use the compiler (cl.exe) to compile and link source code files into apps, libraries, and DLLs.
2. Link
Use the linker (link.exe) to link compiled object files and libraries into apps and DLLs.
3. MSBuild (Visual C++)
Use MSBuild (msbuild.exe) to build Visual C++ projects and Visual Studio solutions. This is equivalent to running the Build project or Build Solution command in the Visual Studio IDE.
4. DEVENV
Use DEVENV (devenv.exe) combined with a command-line switch—for example, /Build or /Clean—to perform certain build commands without displaying the Visual Studio IDE.
5. NMAKE
Use NMAKE (nmake.exe) to automate tasks that build Visual C++ projects by using a traditional makefile.
?
在windows下開發(fā)應(yīng)用或庫時,如果不想安裝完整的visual studio,可以選擇只安裝build tools在命令行下進(jìn)行編譯等操作。這樣可以節(jié)省硬盤空間,實測占用7GB,并且裝在了C盤。
?
1. 下載安裝
打開鏈接下載安裝程序:?Microsoft Visual C++ Build Tools 2015,雙擊visualcppbuildtools_full.exe,選擇默認(rèn)即可,點擊安裝,等待10分鐘左右即可完成安裝。
?
2. 準(zhǔn)備代碼hello_world.c
#include<stdio.h>int main() {printf("hello vs build tools.\n");printf("press any key to exit.\n");getchar();return 0;}?
3. 編譯
1)在開始菜單中選擇Visual C++ 2015 x86 Native Tools Command Prompt打開命令行,然后切換到hello_world.c所在目錄。
2)執(zhí)行:cl hello_world.c
可看到生成兩個文件,分別是hello_world.obj和hello_world.exe
?
4. 測試
執(zhí)行:.\hello_world.exe
或直接雙擊hello_world.exe執(zhí)行。
?
?
總結(jié)
以上是生活随笔為你收集整理的visual c++ build tools的安装与使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Web渗透信息收集之域名、端口、服务、指
- 下一篇: C语言高级编程:二级指针的赋值