1488 0

[问答] visual c++ build tools的安装与使用 [推广有奖]

  • 0关注
  • 9粉丝

已卖:346份资源

讲师

40%

还不是VIP/贵宾

-

威望
0
论坛币
5933 个
通用积分
175.0222
学术水平
10 点
热心指数
13 点
信用等级
8 点
经验
9215 点
帖子
232
精华
0
在线时间
332 小时
注册时间
2018-9-28
最后登录
2020-7-17

楼主
诗人都在海底 在职认证  发表于 2018-11-27 16:16:21 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

开发环境:

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执行。


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝


您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-29 03:22