简体   繁体   English

最小安装即可使用Microsoft Visual Studio运行C ++“ Hello World”程序?

[英]Minimal installation to run a c++ “hello world” program using microsoft visual studio?

I have download the visual studio community 2019, and I just want to run a normal c++ program such as the simplest "hello world" on it. 我已经下载了Visual Studio Community 2019,我只想在其上运行普通的c ++程序,例如最简单的``hello world''。 However due to the limited hard drive space, I would like to install the minimal component. 但是,由于硬盘空间有限,我想安装最少的组件。 From this post by Microsoft, I see one picture of the following: 从Microsoft的这篇文章中 ,我看到以下图片:

在此处输入图片说明

First I thought I don't need all the optional parts on my computer, when finished, there is an error reporting no header files such as iostream . 首先,我认为我不需要计算机上的所有可选部件,完成后会出现错误,报告没有头文件,例如iostream So I go back and install the first component, still can't run. 所以我回去安装第一个组件,仍然无法运行。 So I want to ask what else should I install. 所以我想问我还应该安装什么。 I don't want install more than I need. 我不想安装比我需要的更多的东西。

Here is screenshot from mine (maybe contain some characters you don't recognize, but you can guess from the context), and it is basically what I have installed: 这是我的屏幕截图(也许包含一些您无法识别的字符,但是您可以从上下文中猜测),基本上这是我安装的内容:

在此处输入图片说明

unfortunately to my knowledge, you need to install all the default downloads that Microsoft wants you to install initially. 不幸的是,您需要安装Microsoft最初希望安装的所有默认下载。 The other files besides the core C++ are tools for the compiler and your standard library which is important for a lot of C++'s functionality. 除了核心C ++之外,其他文件都是用于编译器和标准库的工具,这对于许多C ++的功能很重要。 if you dont want to have to re-invent the wheel for every task these standard libraries are immensely important. 如果您不想为每项任务重新发明轮子,那么这些标准库就非常重要。 Things like Vector containers, Ofstream, and Maps are all based in these libraries. Vector容器,Ofstream和Map之类的东西都基于这些库。 As well as that they are important for code compilation and just making visual studio run as a whole. 它们对于代码编译以及使Visual Studio整体运行非常重要。 That being said C++ projects and code dont, for small projects like you were saying, create that large of files so while the initial installation might take a lot of memory once your past that you should be fine. 话虽这么说,C ++项目和代码不会为您所说的小型项目创建那么大的文件,所以一旦您过去就没问题,那么初始安装可能会占用大量内存。

From my experiment, I found that at least these two optional components must be checked: 从我的实验中,我发现至少必须检查以下两个可选组件:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM