原文:https://www.cnblogs.com/marklove/p/10812317.html
-----------------------------------------------------------------
visual c++ build tools的安裝與使用
https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16
https://visualstudio.microsoft.com/zh-hans/vs/older-downloads/isolated-shell/
https://visualstudio.microsoft.com/zh-hans/vs/older-downloads/
https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/?rr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DPA6ECDy6C4Wd-jnXk3BxDdVGHzQMZUS4mF0LdioWvz2r0gFIJD319sXwf5Ockmjgsqia-ccCwb79t_M3vYgXujv4bIlqTbQGh2zh-yO3IZ_%26wd%3D%26eqid%3D94b3b9620003aa54000000055cce5bdd
開發環境:
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下開發應用或庫時,如果不想安裝完整的visual studio,可以選擇只安裝build tools在命令行下進行編譯等操作。這樣可以節省硬盤空間,實測占用7GB,並且裝在了C盤。
1. 下載安裝
打開鏈接下載安裝程序: Microsoft Visual C++ Build Tools 2015,雙擊visualcppbuildtools_full.exe,選擇默認即可,點擊安裝,等待10分鍾左右即可完成安裝。
2. 准備代碼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)執行:cl hello_world.c
可看到生成兩個文件,分別是hello_world.obj和hello_world.exe
4. 測試
執行:.\hello_world.exe
或直接雙擊hello_world.exe執行。
---------------------
作者:crazy_baoli
來源:CSDN
原文:https://blog.csdn.net/u012247418/article/details/82314129
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!