Как добавить c в visual studio 2015
Install C and C++ support in Visual Studio
If you haven't downloaded and installed Visual Studio and the Microsoft C/C++ tools yet, here's how to get started.
Visual Studio 2022 Installation
Welcome to Visual Studio 2022! In this version, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
Want to know more about what else is new in this version? See the Visual Studio release notes.
Ready to install? We'll walk you through it, step-by-step.
Step 1 - Make sure your computer is ready for Visual Studio
Before you begin installing Visual Studio:
Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2022.
Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
Reboot. The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.
Free up space. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.
For questions about running previous versions of Visual Studio side by side with Visual Studio 2022, see the Visual Studio 2022 Platform Targeting and Compatibility page.
Step 2 - Download Visual Studio
Next, download the Visual Studio bootstrapper file. To do so, choose the following button to go to the Visual Studio download page. Select the edition of Visual Studio that you want and choose the Free trial or Free download button.
Step 3 - Install the Visual Studio installer
Run the bootstrapper file you downloaded to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.
From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:
- vs_community.exe for Visual Studio Community
- vs_professional.exe for Visual Studio Professional
- vs_enterprise.exe for Visual Studio Enterprise
If you receive a User Account Control notice, choose Yes to allow the bootstrapper to run.
We'll ask you to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement. Choose Continue.
Step 4 - Choose workloads
After the installer is installed, you can use it to customize your installation by selecting the workloads, or feature sets, that you want. Here's how.
Find the workload you want in the Installing Visual Studio screen.
For core C and C++ support, choose the "Desktop development with C++" workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.
Additional workloads support other kinds of development. For example, choose the "Universal Windows Platform development" workload to create apps that use the Windows Runtime for the Microsoft Store. Choose "Game development with C++" to create games that use DirectX, Unreal, and Cocos2d. Choose "Linux development with C++" to target Linux platforms, including IoT development.
The Installation details pane lists the included and optional components installed by each workload. You can select or deselect optional components in this list. For example, to support development by using the Visual Studio 2017 or 2015 compiler toolsets, choose the MSVC v141 or MSVC v140 optional components. You can add support for MFC, the experimental Modules language extension, IncrediBuild, and more.
After you choose the workload(s) and optional components you want, choose Install.
Next, status screens appear that show the progress of your Visual Studio installation.
[!TIP] At any time after installation, you can install workloads or components that you didn't install initially. If you have Visual Studio open, go to Tools > Get Tools and Features. which opens the Visual Studio Installer. Or, open Visual Studio Installer from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose Modify.
Step 5 - Choose individual components (Optional)
If you don't want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the Individual components tab. Choose what you want, and then follow the prompts.
Step 6 - Install language packs (Optional)
By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.
Change the installer language from the command line
Another way that you can change the default language is by running the installer from the command line. For example, you can force the installer to run in English by using the following command: vs_installer.exe --locale en-US . The installer will remember this setting when it's run the next time. The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.
Step 7 - Change the installation location (Optional)
You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.
[!IMPORTANT] You can select a different drive only when you first install Visual Studio. If you've already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.
Step 8 - Start developing
After Visual Studio installation is complete, choose the Launch button to get started developing with Visual Studio.
On the start window, choose Create a new project.
In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workload(s) that you chose during installation. To see different templates, choose different workloads.
You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.
Visual Studio opens your new project, and you're ready to code!
Visual Studio 2019 Installation
Welcome to Visual Studio 2019! In this version, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
Want to know more about what else is new in this version? See the Visual Studio release notes.
Ready to install? We'll walk you through it, step-by-step.
Step 1 - Make sure your computer is ready for Visual Studio
Before you begin installing Visual Studio:
Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2019.
Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
Reboot. The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.
Free up space. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.
For questions about running previous versions of Visual Studio side by side with Visual Studio 2019, see the Visual Studio 2019 Platform Targeting and Compatibility page.
Step 2 - Download Visual Studio
Next, download the Visual Studio bootstrapper file. To do so, choose the following button to go to the Visual Studio download page. Choose the Download button, then you can select the edition of Visual Studio that you want.
Step 3 - Install the Visual Studio installer
Run the bootstrapper file you downloaded to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.
From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:
- vs_community.exe for Visual Studio Community
- vs_professional.exe for Visual Studio Professional
- vs_enterprise.exe for Visual Studio Enterprise
If you receive a User Account Control notice, choose Yes to allow the bootstrapper to run.
We'll ask you to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement. Choose Continue.
Step 4 - Choose workloads
After the installer is installed, you can use it to customize your installation by selecting the workloads, or feature sets, that you want. Here's how.
Find the workload you want in the Installing Visual Studio screen.
For core C and C++ support, choose the "Desktop development with C++" workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.
Additional workloads support other kinds of development. For example, choose the "Universal Windows Platform development" workload to create apps that use the Windows Runtime for the Microsoft Store. Choose "Game development with C++" to create games that use DirectX, Unreal, and Cocos2d. Choose "Linux development with C++" to target Linux platforms, including IoT development.
The Installation details pane lists the included and optional components installed by each workload. You can select or deselect optional components in this list. For example, to support development by using the Visual Studio 2017 or 2015 compiler toolsets, choose the MSVC v141 or MSVC v140 optional components. You can add support for MFC, the experimental Modules language extension, IncrediBuild, and more.
After you choose the workload(s) and optional components you want, choose Install.
Next, status screens appear that show the progress of your Visual Studio installation.
[!TIP] At any time after installation, you can install workloads or components that you didn't install initially. If you have Visual Studio open, go to Tools > Get Tools and Features. which opens the Visual Studio Installer. Or, open Visual Studio Installer from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose Modify.
Step 5 - Choose individual components (Optional)
If you don't want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the Individual components tab. Choose what you want, and then follow the prompts.
Step 6 - Install language packs (Optional)
By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.
Change the installer language from the command line
Another way that you can change the default language is by running the installer from the command line. For example, you can force the installer to run in English by using the following command: vs_installer.exe --locale en-US . The installer will remember this setting when it's run the next time. The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.
Step 7 - Change the installation location (Optional)
You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.
[!IMPORTANT] You can select a different drive only when you first install Visual Studio. If you've already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.
Step 8 - Start developing
After Visual Studio installation is complete, choose the Launch button to get started developing with Visual Studio.
On the start window, choose Create a new project.
In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workload(s) that you chose during installation. To see different templates, choose different workloads.
You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.
Visual Studio opens your new project, and you're ready to code!
Visual Studio 2017 Installation
In Visual Studio 2017, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
A broadband internet connection. The Visual Studio installer can download several gigabytes of data.
A computer that runs Microsoft Windows 7 or later versions. We recommend the latest version of Windows for the best development experience. Make sure that the latest updates are applied to your system before you install Visual Studio.
Enough free disk space. Visual Studio requires at least 7 GB of disk space, and can take 50 GB or more if many common options are installed. We recommend you install it on your C: drive.
For details on the disk space and operating system requirements, see Visual Studio Product Family System Requirements. The installer reports how much disk space is required for the options you select.
Download and install
To download the latest Visual Studio 2017 installer for Windows, go to the Microsoft Visual Studio Older downloads page. Expand the 2017 section, and choose the Download button.
[!Tip] The Community edition is for individual developers, classroom learning, academic research, and open source development. For other uses, install Visual Studio 2017 Professional or Visual Studio 2017 Enterprise.
Find the installer file you downloaded and run it. The downloaded file may be displayed in your browser, or you may find it in your Downloads folder. The installer needs Administrator privileges to run. You may see a User Account Control dialog asking you to give permission to let the installer make changes to your system; choose Yes. If you're having trouble, find the downloaded file in File Explorer, right-click on the installer icon, and choose Run as Administrator from the context menu.
The installer presents you with a list of workloads, which are groups of related options for specific development areas. Support for C++ is now part of optional workloads that aren't installed by default.
For C and C++, select the Desktop development with C++ workload and then choose Install.
When the installation completes, choose the Launch button to start Visual Studio.
The first time you run Visual Studio, you're asked to sign in with a Microsoft Account. If you don't have one, you can create one for free. You must also choose a theme. Don't worry, you can change it later if you want to.
It may take Visual Studio several minutes to get ready for use the first time you run it. Here's what it looks like in a quick time-lapse:
Visual Studio starts much faster when you run it again.
When Visual Studio opens, check to see if the flag icon in the title bar is highlighted:
If it's highlighted, select it to open the Notifications window. If there are any updates available for Visual Studio, we recommend you install them now. Once the installation is complete, restart Visual Studio.
Visual Studio 2015 Installation
To install Visual Studio 2015, go to the Microsoft Visual Studio Older downloads page. Expand the 2015 section, and choose the Download button. Run the downloaded setup program and choose Custom installation and then choose the C++ component. To add C and C++ support to an existing Visual Studio 2015 installation, click on the Windows Start button and type Add Remove Programs. Open the program from the results list and then find your Visual Studio 2015 installation in the list of installed programs. Double-click it, then choose Modify and select the Visual C++ components to install.
In general, we highly recommend that you use the latest version of Visual Studio even if you need to compile your code using the Visual Studio 2015 compiler. For more information, see Use native multi-targeting in Visual Studio to build old projects.
When Visual Studio is running, you're ready to continue to the next step.
Visual Studio можно использовать для создания стандартных программ на языке C++. Выполнив действия, описанные в этом пошаговом руководстве, можно создать проект, добавить новый файл в проект, изменить файл для добавления кода C++, а затем скомпилировать и запустить программу с помощью Visual Studio.
Можно ввести собственную программу на языке C++ или использовать один из примеров программ. Примером программы в этом пошаговом руководстве является консольное приложение. Это приложение использует set контейнер в стандартной библиотеке C++.
Если требуется соответствие определенной версии стандарта языка C++ (например, C++ 14, C++ 17 или C++ 20), используйте /std:c++14 параметр компилятора, /std:c++17 или /std:c++20 . (Visual Studio 2017 и более поздних версий.)
Предварительные требования
Для выполнения этого пошагового руководства читатель должен владеть основами языка C++.
Создание проекта и Добавление исходного файла
Приведенные ниже инструкции немного отличаются в зависимости от используемой версии Visual Studio. Чтобы ознакомиться с документацией по предпочтительной версии Visual Studio, используйте селектор Версия. Он находится в верхней части оглавления на этой странице.
Создание проекта C++ в Visual Studio
В главном меню выберите Файл >Создать >Проект, чтобы открыть диалоговое окно Создание проекта.
В верхней части диалогового окна задайте для параметра Язык значение C++, для параметра Платформа значение Windows, а для Типа проекта — Консоль.
В отфильтрованном списке типов проектов щелкните Консольное приложение, а затем нажмите кнопку Далее. На следующей странице введите имя проекта и при необходимости укажите расположение проекта.
создание проекта C++ в Visual Studio 2017
Создайте проект, наведя указатель на пункт создать в меню файл и выбрав пункт Project.
на панели типы проектов Visual C++ щелкните Windows рабочий стол, а затем выберите Windows консольное приложение.
Введите имя проекта. По умолчанию решение, содержащее проект, имеет то же имя, что и проект, но можно ввести другое имя. Можно также ввести другое расположение для проекта.
создание проекта C++ в Visual Studio 2015
Создайте проект, наведя указатель на пункт создать в меню файл и выбрав пункт Project.
на панели типы проектов Visual C++ щелкните Windows рабочий стол, а затем выберите Windows консольное приложение.
в диалоговом окне создание Project разверните узел установленные>шаблоны>Visual C++, а затем выберите Win32. В центральной области выберите Консольное приложение Win32.
Введите имя проекта. По умолчанию решение, содержащее проект, имеет то же имя, что и проект, но можно ввести другое имя. Можно также ввести другое расположение для проекта.
Завершите работу мастера приложений Win32.
Добавить новый исходный файл
если Обозреватель решений не отображается, в меню вид выберите пункт Обозреватель решений.
Добавьте в проект новый исходный файл, как показано ниже.
в Обозреватель решенийщелкните правой кнопкой мыши папку исходные файлы , наведите указатель на пункт добавитьи выберите пункт новый элемент.
В узле код щелкните файл C++ (. cpp), введите имя файла и нажмите кнопку добавить.
cpp-файл появится в папке исходные файлы в Обозреватель решений, а файл откроется в редакторе Visual Studio.
В файле в редакторе введите допустимую программу на языке C++, которая использует стандартную библиотеку C++, или скопируйте один из примеров программ и вставьте его в файл.
В меню Сборка выберите Построить решение.
В меню Отладка выберите команду Запуск без отладки.
Если использовался пример программы, откроется окно командной строки, в котором будет указано, найдены ли в наборе определенные целые числа.
If you haven't downloaded and installed Visual Studio and the Microsoft C/C++ tools yet, here's how to get started.
Visual Studio 2022 Installation
Welcome to Visual Studio 2022! In this version, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
Want to know more about what else is new in this version? See the Visual Studio release notes.
Ready to install? We'll walk you through it, step-by-step.
Step 1 - Make sure your computer is ready for Visual Studio
Before you begin installing Visual Studio:
Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2022.
Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
Reboot. The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.
Free up space. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.
For questions about running previous versions of Visual Studio side by side with Visual Studio 2022, see the Visual Studio 2022 Platform Targeting and Compatibility page.
Step 2 - Download Visual Studio
Next, download the Visual Studio bootstrapper file. To do so, choose the following button to go to the Visual Studio download page. Select the edition of Visual Studio that you want and choose the Free trial or Free download button.
Step 3 - Install the Visual Studio installer
Run the bootstrapper file you downloaded to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.
From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:
- vs_community.exe for Visual Studio Community
- vs_professional.exe for Visual Studio Professional
- vs_enterprise.exe for Visual Studio Enterprise
If you receive a User Account Control notice, choose Yes to allow the bootstrapper to run.
We'll ask you to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement. Choose Continue.
Step 4 - Choose workloads
After the installer is installed, you can use it to customize your installation by selecting the workloads, or feature sets, that you want. Here's how.
Find the workload you want in the Installing Visual Studio screen.
For core C and C++ support, choose the "Desktop development with C++" workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.
Additional workloads support other kinds of development. For example, choose the "Universal Windows Platform development" workload to create apps that use the Windows Runtime for the Microsoft Store. Choose "Game development with C++" to create games that use DirectX, Unreal, and Cocos2d. Choose "Linux development with C++" to target Linux platforms, including IoT development.
The Installation details pane lists the included and optional components installed by each workload. You can select or deselect optional components in this list. For example, to support development by using the Visual Studio 2017 or 2015 compiler toolsets, choose the MSVC v141 or MSVC v140 optional components. You can add support for MFC, the experimental Modules language extension, IncrediBuild, and more.
After you choose the workload(s) and optional components you want, choose Install.
Next, status screens appear that show the progress of your Visual Studio installation.
At any time after installation, you can install workloads or components that you didn't install initially. If you have Visual Studio open, go to Tools > Get Tools and Features. which opens the Visual Studio Installer. Or, open Visual Studio Installer from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose Modify.
Step 5 - Choose individual components (Optional)
If you don't want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the Individual components tab. Choose what you want, and then follow the prompts.
Step 6 - Install language packs (Optional)
By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.
Change the installer language from the command line
Another way that you can change the default language is by running the installer from the command line. For example, you can force the installer to run in English by using the following command: vs_installer.exe --locale en-US . The installer will remember this setting when it's run the next time. The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.
Step 7 - Change the installation location (Optional)
You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.
You can select a different drive only when you first install Visual Studio. If you've already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.
Step 8 - Start developing
After Visual Studio installation is complete, choose the Launch button to get started developing with Visual Studio.
On the start window, choose Create a new project.
In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workload(s) that you chose during installation. To see different templates, choose different workloads.
You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.
Visual Studio opens your new project, and you're ready to code!
Visual Studio 2019 Installation
Welcome to Visual Studio 2019! In this version, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
Want to know more about what else is new in this version? See the Visual Studio release notes.
Ready to install? We'll walk you through it, step-by-step.
Step 1 - Make sure your computer is ready for Visual Studio
Before you begin installing Visual Studio:
Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2019.
Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
Reboot. The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.
Free up space. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.
For questions about running previous versions of Visual Studio side by side with Visual Studio 2019, see the Visual Studio 2019 Platform Targeting and Compatibility page.
Step 2 - Download Visual Studio
Next, download the Visual Studio bootstrapper file. To do so, choose the following button to go to the Visual Studio download page. Choose the Download button, then you can select the edition of Visual Studio that you want.
Step 3 - Install the Visual Studio installer
Run the bootstrapper file you downloaded to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.
From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:
- vs_community.exe for Visual Studio Community
- vs_professional.exe for Visual Studio Professional
- vs_enterprise.exe for Visual Studio Enterprise
If you receive a User Account Control notice, choose Yes to allow the bootstrapper to run.
We'll ask you to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement. Choose Continue.
Step 4 - Choose workloads
After the installer is installed, you can use it to customize your installation by selecting the workloads, or feature sets, that you want. Here's how.
Find the workload you want in the Installing Visual Studio screen.
For core C and C++ support, choose the "Desktop development with C++" workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.
Additional workloads support other kinds of development. For example, choose the "Universal Windows Platform development" workload to create apps that use the Windows Runtime for the Microsoft Store. Choose "Game development with C++" to create games that use DirectX, Unreal, and Cocos2d. Choose "Linux development with C++" to target Linux platforms, including IoT development.
The Installation details pane lists the included and optional components installed by each workload. You can select or deselect optional components in this list. For example, to support development by using the Visual Studio 2017 or 2015 compiler toolsets, choose the MSVC v141 or MSVC v140 optional components. You can add support for MFC, the experimental Modules language extension, IncrediBuild, and more.
After you choose the workload(s) and optional components you want, choose Install.
Next, status screens appear that show the progress of your Visual Studio installation.
At any time after installation, you can install workloads or components that you didn't install initially. If you have Visual Studio open, go to Tools > Get Tools and Features. which opens the Visual Studio Installer. Or, open Visual Studio Installer from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose Modify.
Step 5 - Choose individual components (Optional)
If you don't want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the Individual components tab. Choose what you want, and then follow the prompts.
Step 6 - Install language packs (Optional)
By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.
Change the installer language from the command line
Another way that you can change the default language is by running the installer from the command line. For example, you can force the installer to run in English by using the following command: vs_installer.exe --locale en-US . The installer will remember this setting when it's run the next time. The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.
Step 7 - Change the installation location (Optional)
You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.
You can select a different drive only when you first install Visual Studio. If you've already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.
Step 8 - Start developing
After Visual Studio installation is complete, choose the Launch button to get started developing with Visual Studio.
On the start window, choose Create a new project.
In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workload(s) that you chose during installation. To see different templates, choose different workloads.
You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.
Visual Studio opens your new project, and you're ready to code!
Visual Studio 2017 Installation
In Visual Studio 2017, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.
Prerequisites
A broadband internet connection. The Visual Studio installer can download several gigabytes of data.
A computer that runs Microsoft Windows 7 or later versions. We recommend the latest version of Windows for the best development experience. Make sure that the latest updates are applied to your system before you install Visual Studio.
Enough free disk space. Visual Studio requires at least 7 GB of disk space, and can take 50 GB or more if many common options are installed. We recommend you install it on your C: drive.
For details on the disk space and operating system requirements, see Visual Studio Product Family System Requirements. The installer reports how much disk space is required for the options you select.
Download and install
To download the latest Visual Studio 2017 installer for Windows, go to the Microsoft Visual Studio Older downloads page. Expand the 2017 section, and choose the Download button.
The Community edition is for individual developers, classroom learning, academic research, and open source development. For other uses, install Visual Studio 2017 Professional or Visual Studio 2017 Enterprise.
Find the installer file you downloaded and run it. The downloaded file may be displayed in your browser, or you may find it in your Downloads folder. The installer needs Administrator privileges to run. You may see a User Account Control dialog asking you to give permission to let the installer make changes to your system; choose Yes. If you're having trouble, find the downloaded file in File Explorer, right-click on the installer icon, and choose Run as Administrator from the context menu.
The installer presents you with a list of workloads, which are groups of related options for specific development areas. Support for C++ is now part of optional workloads that aren't installed by default.
For C and C++, select the Desktop development with C++ workload and then choose Install.
When the installation completes, choose the Launch button to start Visual Studio.
The first time you run Visual Studio, you're asked to sign in with a Microsoft Account. If you don't have one, you can create one for free. You must also choose a theme. Don't worry, you can change it later if you want to.
It may take Visual Studio several minutes to get ready for use the first time you run it. Here's what it looks like in a quick time-lapse:
Visual Studio starts much faster when you run it again.
When Visual Studio opens, check to see if the flag icon in the title bar is highlighted:
If it's highlighted, select it to open the Notifications window. If there are any updates available for Visual Studio, we recommend you install them now. Once the installation is complete, restart Visual Studio.
Visual Studio 2015 Installation
To install Visual Studio 2015, go to the Microsoft Visual Studio Older downloads page. Expand the 2015 section, and choose the Download button. Run the downloaded setup program and choose Custom installation and then choose the C++ component. To add C and C++ support to an existing Visual Studio 2015 installation, click on the Windows Start button and type Add Remove Programs. Open the program from the results list and then find your Visual Studio 2015 installation in the list of installed programs. Double-click it, then choose Modify and select the Visual C++ components to install.
In general, we highly recommend that you use the latest version of Visual Studio even if you need to compile your code using the Visual Studio 2015 compiler. For more information, see Use native multi-targeting in Visual Studio to build old projects.
When Visual Studio is running, you're ready to continue to the next step.
Вы находитесь здесь, так как ищете скачивание одного из файлов среды выполнения Visual C++? Перейдите на страницу последних поддерживаемых Распространяемый компонент Visual C++ скачивания.
Распространяемые файлы и лицензирование
При развертывании приложения необходимо также развернуть файлы, поддерживающие это приложение. Если какой-либо из этих файлов предоставляется корпорацией Майкрософт, проверьте, разрешено ли повторно распространять их. Вы найдете ссылку на условия лицензии Visual Studio в интегрированной среде разработки. Используйте ссылку "Условия лицензии" в диалоговом окне "О Microsoft Visual Studio". Также можно скачать соответствующие EULA и лицензии из каталога лицензий Visual Studio.
Чтобы просмотреть список REDIST, на который ссылается раздел "Распространяемый код" Visual Studio 2022 условия лицензионного соглашения на использование программного обеспечения Майкрософт, см. раздел "Файлы распространяемого кода" для Microsoft Visual Studio 2022 г.
Чтобы просмотреть список REDIST, на который ссылается раздел "Распространяемый код" условий лицензионного соглашения на Visual Studio 2019 г., см. раздел "Файлы распространяемого кода" для Microsoft Visual Studio 2019 г.
Чтобы просмотреть список REDIST, на который ссылается раздел "Распространяемый код" Visual Studio 2017 условий лицензионного соглашения на использование программного обеспечения Майкрософт, см. раздел "Файлы распространяемого кода" для Microsoft Visual Studio 2017 года.
Чтобы просмотреть список REDIST, на который ссылается раздел "Распространяемый код" Visual Studio 2015 условий лицензионного соглашения на использование программного обеспечения Майкрософт, см. раздел "Файлы распространяемого кода" для Microsoft Visual Studio 2015 года.
Дополнительные сведения о распространяемых файлах см. в разделе "Определение библиотек DLL для распространения и примеров развертывания".
Поиск распространяемых файлов
Для развертывания распространяемых файлов можно использовать распространяемые пакеты, установленные Visual Studio. В версиях Visual Studio с 2017 года эти файлы называются vc_redist.arm64.exe и vc_redist.x64.exe vc_redist.x86.exe . В Visual Studio 2015, 2017 и 2019 годах они также доступны под именами vcredist_x86.exe , vcredist_x64.exe и (только 2015). vcredist_arm.exe
Самый простой способ найти распространяемые файлы — использовать переменные среды, заданные в командной строке разработчика. В Visual Studio 2022 распространяемые файлы находятся в папке %VCINSTALLDIR%Redist\MSVC\v143 . В последней версии Visual Studio 2019 вы найдете распространяемые файлы в папке %VCINSTALLDIR%Redist\MSVC\v142 . В Visual Studio 2017 и Visual Studio 2019, они также находятся в %VCToolsRedistDir% . В Visual Studio 2015 эти файлы можно найти в %VCINSTALLDIR%redist\ расположении языкового стандарта распространяемых пакетов.
В Visual Studio 2022 и 2019 файлы модулей слияния являются частью дополнительно устанавливаемого компонента с именем распространяемых MSM версии> C++ в Visual Studio Installer. Модули слияния устанавливаются по умолчанию как часть установки C++ в Visual Studio 2017 и Visual Studio 2015. При установке в Visual Studio 2022 вы найдете распространяемые модули слияния в %VCINSTALLDIR%Redist\MSVC\v143\MergeModules . В последней версии Visual Studio 2019 распространяемые модули слияния находятся в %VCINSTALLDIR%Redist\MSVC\v142\MergeModules . В обоих Visual Studio 2019 и Visual Studio 2017 года они также находятся в %VCToolsRedistDir%MergeModules . В Visual Studio 2015 года они находятся в Program Files [(x86)]\Common Files\Merge Modules .
Установка распространяемых пакетов
Распространяемые пакеты Visual C++ позволяют устанавливать и регистрировать все библиотеки Visual C++. Если вы используете его, запустите его в качестве необходимого компонента в целевой системе перед установкой приложения. Рекомендуется использовать эти пакеты для развертываний, поскольку они включают функцию автоматического обновления библиотек Visual C++. Пример использования этих пакетов см. в разделе Пошаговое руководство. Развертывание приложения Visual C++ с помощью распространяемого пакета Visual C++.
Установка распространяемых модулей слияния
Модули слияния ( .msm файлы) для Распространяемый компонент Visual C++ файлов устарели. Мы не рекомендуем использовать их для развертывания приложений. Вместо этого рекомендуется централизованное развертывание пакета Распространяемый компонент Visual C++. Централизованное развертывание распространяемым пакетом позволяет корпорации Майкрософт обслуживать файлы библиотеки среды выполнения независимо. Кроме того, удаление приложения не может повлиять на другие приложения, которые также используют централизованное развертывание. При использовании распространяемого пакета для централизованного развертывания вы не несете ответственности за отслеживание и обслуживание библиотек среды выполнения. В противном случае обновление файлов библиотеки среды выполнения требует обновления и повторного развертывания установщика .msi . Ваше приложение может быть уязвимо к ошибкам или проблемам безопасности до тех пор, пока вы не сделаете это.
Распространяемые модули слияния должны быть включены в пакет установщика Windows (или аналогичный пакет установки), используемый для развертывания приложения. Дополнительные сведения см. в разделе "Распространение с помощью модулей слияния". Пример см. в пошаговом руководстве. Развертывание приложения Visual C++ с помощью проекта установки.
Установка отдельных распространяемых файлов
Также можно напрямую установить распространяемые библиотеки DLL в локальной папке приложения. Локальная папка приложения — это папка, содержащая исполняемый файл приложения. По соображениям обслуживания мы не рекомендуем использовать это расположение установки.
Потенциальные ошибки во время выполнения
Чтобы устранить эту ошибку, убедитесь, что установщик приложения выполняет сборку правильно. Убедитесь, что распространяемые библиотеки правильно развернуты в целевой системе. Дополнительные сведения см. в разделе Основные сведения о зависимостях приложения Visual C++.
Связанные статьи
Распространение с помощью модулей слияния
Описывает, как использовать модули слияния Распространяемый компонент Visual C++ для установки библиотек среды выполнения Visual C++ в качестве общих библиотек DLL в папке %windir%\system32\ .
Распространение элементов управления ActiveX в Visual C++
Описание процедуры повторного распространения приложения, которое использует элементы управления ActiveX.
Распространение библиотеки MFC
Описание процедуры повторного распространения приложения, которое использует MFC.
Повторное распространение приложения ATL
Описание способа распространения приложения, которое использует ATL. В Visual Studio 2012 и более поздних версиях библиотека ATL не требуется.
Примеры развертывания
Ссылки на примеры, демонстрирующие развертывание приложений Visual C++.
Развертывание классических приложений
Представлены технологии развертывания Visual C++ и связанные понятия.
Уроки программирования, алгоритмы, статьи, исходники, примеры программ и полезные советы
Windows Forms и C++
Сначала необходимо создать новый проект в Visual Studio.
Создание нового проекта C++ в Visual Studio
Запустите Visual Studio. Нажмите «Файл» → «Создать» → «Проект…». Или нажмите сочетание клавиш Ctrl + Shift + N на клавиатуре.
В появившемся окне «Создать проект» слева выберите группу «Visual C++», а в ней пункт «CLR». Щелкните по «Пустой проект CLR», введите имя проекта и нажмите кнопку «OK».
Таким образом мы создали новый проект на языке программирования C++ в Visual Studio.
Добавление Windows Forms в проект C++
Теперь в созданный проект на C++ добавим форму Windows Forms.
Для этого щелкните в «Обозревателе решений» на названии проекта правой кнопкой мыши, выберите пункт «Добавить» и затем «Создать элемент…». Либо просто нажмите на клавиатуре сочетание клавиш Ctrl + Shift + A.
Загрузится окно «Добавление нового элемента». В нём щёлкните левой кнопкой мыши по группе UI в выберите элемент «Форма Windows Forms — Visual C++». Можете изменить имя создаваемой формы. По завершении нажмите кнопку «Добавить».
Далее откройте файл исходного кода «MyForm.cpp» (если вы изменяли название формы, то файл будет иметь другое имя). В него добавьте следующий текст:
Если Вы указали имя проекта отличное от WinFormsTest, то, соответственно, в коде укажите введённое Вами имя.
Сохраните изменения в файле.
Теперь необходимо произвести ряд настроек проекта в Visual Studio. Приступим.
Щёлкните по названию проекта в «Обозревателе решений» правой кнопкой мыши и затем нажмите кнопку «Свойства». Либо сразу нажмите сочетание клавиш Alt + Enter.
Далее в разделе «Дополнительно» группы «Компоновщик» в качестве «Точки входа» укажите функцию main (напишите словом). Щелкните кнопку «Применить», а затем «ОК».
На этом настройка и создание проекта Windows Forms на C++ завершены! Чтобы просмотреть результат — запустите проект на выполнение (клавиша F5).
Читайте также: