PrevUpHomeNext

Microsoft Visualcpp - Windows c++ compiler


Jump in this page:
Start
Download
Install
Check
Enable c++26, c++latest
Command: cl.exe

Back: c++ compilers

Install Visualcpp c++ compiler on windows. Visualcpp is also named msvc, vcpp, visual studio, etc.

Download

Find the visualcpp on official webpages and download:

Microsoft Visualcpp: https://visualstudio.microsoft.com/downloads

For open-source cases, the community edition is good;
For commercial cases, the professional and enterprise editions are good,
it is up to you to choose.

Install

After downloading the related installer setup.exe, click it,
and follow the installer step-by-step,
when it asks the compiler or libraries,
make sure you choose the c++ desktop version, c++ compiler, etc.

Check

When finishing installing,
open the visualcpp IDE,
Create a new project,
Select empty c++ project,
Add a new item hello.cpp to the source files,
Make sure hello.cpp is open in IDE,
and copy the following code to hello.cpp:

#include <iostream>

int main()
{
	std::cout << "Hello, c++!" << std::endl;
}

Then click Build/Run button to compile and run the c++ code,
the button might have a different name, find it by youself.

It should open a cmd window and show Hello, c++!

If it does not show that message and reports errors,
check your installation and configure, solve the installing problems.

Enable c++26, c++latest

Create a new project,
then
->

Click Project on the menubar ->

Click Project Properties ->

Click c++ ->

Click Langauge ->

Find the c++ Language standard ->

Select Preview, ..., /std:c++latest

Compiler command cl.exe

Microsoft visualcpp c++ compiler can be used as
a commandline command on the cmd window too,
the cmd is cl.exe .

Copy-paste the above c++ code, save it as hello.cpp,

then open "Developer Command Prompt for VS" cmd window,

Run the compiling command:

cl.exe hello.cpp /std:c++latest

Also try:

/std:c++26

/std:c++23

Date

Date: Nov 02, 2024

Last Update: Sep 06, 2026

Back

Back: c++ compilers

Helpful

Spaceship 50 Years Alienated

Role

+

Powered by:
B2 Build | boost quickbook

+

Donate

+

@cppfx.xyz


















PrevUpHomeNext