C++ Team Blog

C++ tutorials, C and C++ news, and information about Visual Studio, Visual Studio Code, and Vcpkg from the Microsoft C++ team.

Concurrency Code Analysis in Visual Studio 2019

Concurrency Code Analysis in Visual Studio 2019

The battle against concurrency bugs poses a serious challenge to C++ developers. The problem is exacerbated by the advent of multi-core and many-core architectures. To cope with the increasing complexity of multithreaded software,

Introducing the New CMake Project Settings UI

Visual Studio 2019 Preview 2 introduces a new CMake Project Settings Editor to help you more easily configure your CMake projects in Visual Studio. The editor provides an alternative to modifying the CMakeSettings.json file directly and allows you to create and manage your CMake configurations.

New Start Window and New Project Dialog Experience in Visual Studio 2019

Two features available in Visual Studio 2019 Preview 1 for C++ developers are the start window and a revamped new project dialog. The start window moves the core features from the Visual Studio Start Page, which normally appeared in the editor space when Visual Studio is launched, out into a separate window that appears before the IDE launches. The window includes five main sections: Open recent, Clone or checkout code, Open a project or solution, Open a local folder, Create a new project. It is also possible to continue past the window without opening any code by choosing “Continue without code”. Let’s dig into the features of the start window.

Announcement

Making C++ Exception Handling Smaller On x64

Visual Studio 2019 Preview 3 introduces a new feature to reduce the binary size of C++ exception handling (try/catch and automatic destructors) on x64. Dubbed FH4 (for __CxxFrameHandler4, see below), I developed new formatting and processing for data used for C++ exception handling that is ~60% smaller than the existing implementation resulting in overall binary reduction of up to 20% for programs with heavy usage of C++ exception handling.

CUDA 10.1 available now, with support for latest Microsoft Visual Studio 2019 versions

We are pleased to echo NVIDIA’s announcement for CUDA 10.1 today, and are particularly excited about CUDA 10.1’s continued compatibility for Visual Studio. CUDA 10.1 will work with RC, RTW and future updates of Visual Studio 2019.

Open Existing CMake Caches in Visual Studio

Visual Studio typically manages all the details of CMake for you, under the hood, when you open a project. However, some development workflows require more fine-grained control over how CMake is invoked. The latest Visual Studio 2019 Preview lets you have complete control over CMake if your project needs more flexibility.

Visual Studio 2019 Preview 2 Blog Rollup

Visual Studio 2019 Preview 2 was a huge release for us, so we’ve written a host of articles to explore the changes in more detail. For the short version, see the Visual Studio 2019 Preview 2 Release Notes.

What’s New in CMake – Visual Studio 2019 Preview 2

We have made a bunch of improvements to Visual Studio’s CMake support in the latest preview of the IDE. Many of these changes are taking the first steps to close the gap between working with solutions generated by CMake and the IDE’s native support.

C++ Binary Compatibility and Pain-Free Upgrades to Visual Studio 2019

Visual Studio 2019 pushes the boundaries of individual and team productivity. We hope that you will find these new capabilities compelling and start your upgrade to Visual Studio 2019 soon.

As you are considering this upgrade,

Visual Studio Code C/C++ extension: January 2019 Update

The January 2019 update of the Visual Studio Code C++ extension is now available. This release includes many new features and bug fixes including documentation comments support, improved #include autocomplete performance, better member function completion, and many IntelliSense bug fixes.

New Code Analysis Checks in Visual Studio 2019: use-after-move and coroutine

Visual Studio 2019 Preview 2 is an exciting release for the C++ code analysis team. In this release, we shipped a new set of experimental rules that help you catch bugs in your codebase, namely: use-after-move and coroutine checks.

Concurrency Code Analysis in Visual Studio 2019

Concurrency Code Analysis in Visual Studio 2019

The battle against concurrency bugs poses a serious challenge to C++ developers. The problem is exacerbated by the advent of multi-core and many-core architectures. To cope with the increasing complexity of multithreaded software,

Introducing the New CMake Project Settings UI

Visual Studio 2019 Preview 2 introduces a new CMake Project Settings Editor to help you more easily configure your CMake projects in Visual Studio. The editor provides an alternative to modifying the CMakeSettings.json file directly and allows you to create and manage your CMake configurations.

C++ Q&A Series

Clang

Exploring Clang Tooling Part 3: Rewriting Code with clang-tidy

In the previous post in this series, we used clang-query to examine the Abstract Syntax Tree of a simple source code file. Using clang-query, we can prototype an AST Matcher which we can use in a clang-tidy check to refactor code in bulk.

Exploring Clang Tooling Part 2: Examining the Clang AST with clang-query

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Exploring Clang Tooling Part 1: Extending Clang-Tidy

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Exploring Clang Tooling, Part 0: Building Your Code with Clang

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

CMake

Open Existing CMake Caches in Visual Studio

Visual Studio typically manages all the details of CMake for you, under the hood, when you open a project. However, some development workflows require more fine-grained control over how CMake is invoked. The latest Visual Studio 2019 Preview lets you have complete control over CMake if your project needs more flexibility.

What’s New in CMake – Visual Studio 2019 Preview 2

We have made a bunch of improvements to Visual Studio’s CMake support in the latest preview of the IDE. Many of these changes are taking the first steps to close the gap between working with solutions generated by CMake and the IDE’s native support.

Introducing the New CMake Project Settings UI

Visual Studio 2019 Preview 2 introduces a new CMake Project Settings Editor to help you more easily configure your CMake projects in Visual Studio. The editor provides an alternative to modifying the CMakeSettings.json file directly and allows you to create and manage your CMake configurations.

Using multi-stage containers for C++ development

Containers are a great tool for configuring reproducible build environments. It’s fairly easy to find Dockerfiles that provide various C++ environments. Unfortunately, it is hard to find guidance on how to use newer techniques like multi-stage builds. This post will show you how you can leverage the capabilities of multi-stage containers for your C++ development.

Visual Studio Code C/C++ extension July 2018 Update and IntelliSense auto-configuration for CMake

Last week we shipped the July 2018 update to the C/C++ extension for Visual Studio Code. In this update we added support for a new experimental API that allows build system extensions to pass IntelliSense configuration information to our extension for powering up full IntelliSense experience.

CMake Support in Visual Studio – Configuration Templates

Visual Studio 2017 15.8 Preview 3 is now available and it includes several improvements to the CMake tools. In addition to a few fixes we have simplified the way you can configure your CMakeSettings.json file by adding configuration templates.

CMake Support in Visual Studio – Code Analysis and CMake 3.11

Visual Studio 2017 15.7 Preview 4 is now available and we have added a few more CMake features in addition to the Targets View and single file compilation added in Preview 3.  We keep the version of CMake that ships with Visual Studio as fresh as possible,

CMake Support in Visual Studio – Targets View, Single File Compilation, and Cache Generation Settings

Visual Studio 2017 15.7 Preview 3 is now available, which includes several improvements to the CMake tools.  The latest preview offers more control than ever over how to visualize, build, and manage your CMake projects.

Please download the preview and check out the latest CMake features such as the Targets View,

Linux C++ Workload improvements to the Project System, Linux Console Window, rsync and Attach to Process

点这里看中文版

In Visual Studio 2017 15.7 Preview 1 we have made a number of improvements to our support to the Linux C++ workload based on your feedback. You can learn more about our Linux C++ workload in Visual Studio here.

CMake Support in Visual Studio – Test Explorer Integration, CMake 3.10

点这里看中文版

We are excited to announce new CMake features in Visual Studio 2017 version 15.6 Preview 2.  In the latest preview, we have improved CTest’s integration with the IDE, including rich support for the Google and Boost unit testing frameworks.

Containers

Using multi-stage containers for C++ development

Containers are a great tool for configuring reproducible build environments. It’s fairly easy to find Dockerfiles that provide various C++ environments. Unfortunately, it is hard to find guidance on how to use newer techniques like multi-stage builds. This post will show you how you can leverage the capabilities of multi-stage containers for your C++ development.

C++ development with Docker containers in Visual Studio Code

Containers allow developers to package up an application with all the parts it needs, such as libraries and other dependencies, and ship it all out as one image. This is especially useful for C++ cross-platform development – with containers you can choose to target a platform that runs on a completely different operating system than your developer machine.

Using MSVC in a Docker Container for Your C++ Projects

Containers encapsulate the runtime environment of an application: the file system, environment settings, and virtualized OS are bundled into a package. Docker containers have changed the way we think about build and test environments since they were introduced five years ago.

Coroutine

Using C++ Resumable Functions with Libuv

Previously on this blog we have talked about Resumable Functions, and even recently we touched on the renaming of the yield keyword to co_yield in our implementation in Visual Studio 2017. I am very excited about this potential C++ standards feature,

`yield` keyword to become `co_yield` in VS 2017

Coroutines—formerly known as “C++ resumable functions”—are one of the Technical Specifications (TS) that we have implemented in the Visual C++ compiler. We’ve supported coroutines for three years—ever since the VC++ November 2013 CTP release.

Diagnostics

Step Back – Going Back in C++ Time

Step Back for C++

In the most recent, 15.9, update to Visual Studio 2017 Enterprise Edition, we’ve added “Step Back” for C++ developers targeting Windows 10 Anniversary Update (1607) and later. With this feature, you can now return to a previous state while debugging without having to restart the entire process.

C++ Core Checks in Visual Studio 2017 15.7 Preview 2

This post was written by Sergiy Oryekhov.

The C++ Core Guidelines Check extension received several new rules in Visual Studio 2017 15.7 Preview 2. The primary focus in this iteration was on the checks that would make it easier to adopt utilities from the Guidelines Support Library.

C++ Code Analysis Improvements for Visual Studio 2017 15.7 Preview 1

点这里看中文版

We’re making it easier to configure and use the C++ code analysis features with a set of changes targeting 15.7. In the first 15.7 preview we’ve cleaned up the UI, fixed our documentation links and,

Arithmetic overflow checks in C++ Core Check

点这里看中文版

We’ve improved the C++ Code Analysis toolset with every major compiler update in Visual Studio 2017. Version 15.6, now in Preview, includes a set of arithmetic overflow checks. This article discusses those checks and why you’ll want to enable them in your code.

Image Watch is now available for Visual Studio 2017

点这里看中文版

Image Watch is a Visual Studio extension that provides a watch window for viewing in-memory bitmaps when debugging native C++ code. It comes with built-in support for OpenCV image types (e.g. cv::Mat, cv::Mat_<> , etc.).

Broken Warnings Theory

Перевод статьи на русском

The “broken warnings theory” is a fictional theory of the norm-setting and signaling effect of coding practices and bug-checking techniques in 3rd party libraries on new bugs and design anti-patterns.

Diagnostic Improvements in Visual Studio 2017 15.3.0

This post as well as described diagnostics significantly benefited from the feedback by Mark, Xiang, Stephan, Marian, Gabriel, Ulzii, Steve and Andrew.

Visual Studio 2017 15.3.0 release comes with a number of improvements to the Microsoft Visual C++ compiler’s diagnostics.

Precompiled Header (PCH) issues and recommendations

This post written by Mark Hall, Xiang Fan, Yuriy Solodkyy, Bat-Ulzii Luvsanbat, and Andrew Pardoe.

Precompiled headers can reduce your compilation times significantly. They’ve worked reliably for millions of developers since they were introduced 25 years ago to speed up builds of MFC apps.

Format Specifiers Checking

By popular request, in Visual Studio 2015 RTM, we’ve implemented the checking of arguments given to printf/scanf and their variations in the C standard library. You can try the examples from this post in our online compiler.

Documentation

Using Visual Studio for Cross Platform C++ Development Targeting Windows and Linux

A great strength of C++ is the ability to target multiple platforms without sacrificing performance. If you are using the same codebase for multiple targets, then CMake is the most common solution for building your software. You can use Visual Studio for your C++ cross platform development when using CMake without needing to create or generate Visual Studio projects.

STL Features and Fixes in VS 2017 15.8

15.7 was our first feature complete C++17 library (except floating-point <charconv>), and in 15.8 we have addressed large numbers of outstanding bugs. As usual, we’ve maintained a detailed list of the STL fixes that are available. Visual Studio 2017 15.8 is available at https://visualstudio.microsoft.com/vs/.

Using C++17 Parallel Algorithms for Better Performance

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Shared PCH usage sample in Visual Studio

This post was written by Olga Arkhipova and Xiang Fan

Oftentimes, multiple projects in a Visual Studio solution use the same (or very similar) precompiled headers. As pch files are often big and building them takes a significant amount of time,

Configuring C++ IntelliSense and Browsing

Whether you are creating a new (or modifying an existing) C++ project using a Wizard, or importing an project into Visual Studio from another IDE, it’s important to configure the project correctly for the IntelliSense and Browsing features to provide accurate information. 

Continuous Integration for C++ with Visual Studio Team Services

Visual Studio Team Services (VSTS) is an easy way to help your team manage code and stay connected when developing. VSTS supports continuous integration using a shared code repository that everyone on the team uses to check in code changes.

Targeting the Windows Subsystem for Linux from Visual Studio

The Windows Subsystem for Linux (WSL) was first introduced at Build in 2016 and was delivered as an early beta in Windows 10 Anniversary Update. Since then, the WSL team has been hard at work, dramatically improving WSL’s abilty to run an ever increasing number of native Linux command-line binaries and tools,

Visual C++ docs: the future is… soon!

We on the Visual C++ documentation team are pleased to announce some changes to the API reference content in the following Visual C++ libraries: STL, MFC, ATL, AMP, and ConcRT.

Since the beginning of MSDN online, the Visual C++ libraries have documented each class member,

Experimental

New Code Analysis Checks in Visual Studio 2019: use-after-move and coroutine

Visual Studio 2019 Preview 2 is an exciting release for the C++ code analysis team. In this release, we shipped a new set of experimental rules that help you catch bugs in your codebase, namely: use-after-move and coroutine checks.

MSVC Preprocessor Progress towards Conformance

Why re-write the preprocessor?

Recently, we published a blog post on C++ conformance completion. As mentioned in the blog post, the preprocessor in MSVC is currently getting an overhaul. We are doing this to improve its language conformance,

New, experimental code analysis features in Visual Studio 2017 15.8 Preview 3

The Visual C++ team has been working to refresh our code analysis experience inside Visual Studio. We’re aiming to make these tools both more useful and natural to use and hope that they’ll benefit you no matter your workflow, style,

Broken Warnings Theory

Перевод статьи на русском

The “broken warnings theory” is a fictional theory of the norm-setting and signaling effect of coding practices and bug-checking techniques in 3rd party libraries on new bugs and design anti-patterns.

Precompiled Header (PCH) issues and recommendations

This post written by Mark Hall, Xiang Fan, Yuriy Solodkyy, Bat-Ulzii Luvsanbat, and Andrew Pardoe.

Precompiled headers can reduce your compilation times significantly. They’ve worked reliably for millions of developers since they were introduced 25 years ago to speed up builds of MFC apps.

Clang 3.8 in the May release of Clang with Microsoft CodeGen

This blog post written by Dave Bartolomeo, Yuriy Solodkyy, and Andrew Pardoe

We have just released our fifth out-of-band update of Clang/C2 toolset. As always, this release has been driven by your feedback. While we’ve heard a lot of feature requests the one’s we’ve heard most frequently are that you want Clang 3.8 and you want x64-hosted compilers.

Clang with Microsoft CodeGen (January 2016) released

We have just released an out-of-band update of Clang/C2 toolset that brings in some of the community fixes as well as bugs found from testing. This is one of many rapid releases to come in the future, and issues reported from customers will be addressed progressively.

Visual Studio 2015 Update 1: New Experimental Feature – MPX

Introduction

This post is about Intel® Memory Protection Extensions (Intel® MPX) support in Microsoft Visual Studio* 2015; content provided by Gautham Beeraka, George Kuan, and Juan Rodriguez from Intel Corporation.

  

Overview

Update 1 for Visual Studio 2015 was announced on November 30,

Clang with Microsoft CodeGen in VS 2015 Update 1

[This post was written by Dave Bartolomeo and the Clang/C2 feature crew]

One of the challenges with developing and maintaining cross-platform C++ code is dealing with different C++ compilers for different platforms. You write some code that builds fine with the Visual C++ compiler for your Windows-targeting build,

faster

Linker Throughput Improvement in Visual Studio 2019

In Visual Studio 2019 Preview 2 we made the compiler back-end to prune away debug information that is unrelated to code or data emitted into binary and changed certain hash implementations in the PDB engine, to improve linker throughput, which resulted in more than 2x reduction on link time for some large AAA game title.

Visual Studio 2017 Throughput Improvements and Advice

点这里看中文版

As C++ programs get larger and larger and the optimizer becomes more complex the compiler’s build time, or throughput, increasingly comes into focus. It’s something that needs to be continually addressed as new patterns emerge and take hold (such as “unity”

Faster C++ build cycle in VS 2017 with /Debug:fastlink

Continuing with our goal of further improving developer productivity with Visual Studio 2017 there have been major investments made for also improving incremental developer builds. The developer incremental build is one where a developer changes a single or multiple source files and builds.

Faster C++ solution load with VS 2017

The Visual C++ product has had projects ever since its inception.  Visual C++ had its own IDE up through Visual Studio 6.  Starting in Visual Studio .NET, C++ moved to a new IDE shared by Visual Basic, C#, C++, and other tools. 

General C++ Series

Q&A: Fine-grained friendship

This post is part of a regular series of posts where the C++ product team here at Microsoft answers questions we have received from customers. The questions can be about anything C++ related: Visual C++,

Exploring Clang Tooling Part 3: Rewriting Code with clang-tidy

In the previous post in this series, we used clang-query to examine the Abstract Syntax Tree of a simple source code file. Using clang-query, we can prototype an AST Matcher which we can use in a clang-tidy check to refactor code in bulk.

Exploring Clang Tooling Part 2: Examining the Clang AST with clang-query

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Exploring Clang Tooling Part 1: Extending Clang-Tidy

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Standard Library Algorithms: Changes and Additions in C++17

Today we have a guest post from Marc Gregoire, Software Architect at Nikon Metrology and Microsoft MVP since 2007.

 

The C++14 standard already contains a wealth of different kinds of algorithms. C++17 adds a couple more algorithms and updates some existing ones.

How to Use Class Template Argument Deduction

Class Template Argument Deduction (CTAD) is a C++17 Core Language feature that reduces code verbosity. C++17’s Standard Library also supports CTAD, so after upgrading your toolset, you can take advantage of this new feature when using STL types like std::pair and std::vector.

std::any: How, when, and why

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset,

Books on C++17

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Exploring Clang Tooling, Part 0: Building Your Code with Clang

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Using C++17 Parallel Algorithms for Better Performance

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

IoT

ARM GCC Cross Compilation in Visual Studio

点这里看中文版

⏱ Updated on January 10, 2018 to cover addition of debugging support in Visual Studio 2017 15.6

In Visual Studio 2017 15.5 we are introduced support for cross compilation targeting ARM microcontrollers.

Visual C++ for Linux 1.0.5 Updates

The Visual C++ for Linux announcement post has been updated with the content below. If you are already familiar with this extension this post covers what is new since our last update.

We recently posted new bits for our 1.0.5 release of the Visual C++ for Linux extension for Visual Studio 2015.

Visual C++ for Linux Updates

Updated 6/14/2016: We updated the original announcement post with the content below if you want a single page that covers everything about this extension. The below remains the same and just covers the updates from the original release.

Linux

Introducing the New CMake Project Settings UI

Visual Studio 2019 Preview 2 introduces a new CMake Project Settings Editor to help you more easily configure your CMake projects in Visual Studio. The editor provides an alternative to modifying the CMakeSettings.json file directly and allows you to create and manage your CMake configurations.

Using multi-stage containers for C++ development

Containers are a great tool for configuring reproducible build environments. It’s fairly easy to find Dockerfiles that provide various C++ environments. Unfortunately, it is hard to find guidance on how to use newer techniques like multi-stage builds. This post will show you how you can leverage the capabilities of multi-stage containers for your C++ development.

Linux C++ Workload improvements to the Project System, Linux Console Window, rsync and Attach to Process

点这里看中文版

In Visual Studio 2017 15.7 Preview 1 we have made a number of improvements to our support to the Linux C++ workload based on your feedback. You can learn more about our Linux C++ workload in Visual Studio here.

Remote tasks in Visual Studio

We have introduced a new capability to run remote tasks in Visual Studio 2017 15.5 Preview 2.  This capability allows you to run any command on a remote system that is defined in Visual Studio’s Connection Manager.

Visual C++ for Linux Development with CMake

In Visual Studio 2017 15.4 you can now target Linux from your CMake projects. This enables you to work on your existing code base that uses CMake as your build solution without having to convert it to a VS project.

Learn C++ Concepts with Visual Studio and the WSL

点这里看中文版

Concepts promise to fundamentally change how we write templated C++ code. They’re in a Technical Specification (TS) right now, but, like Coroutines, Modules, and Ranges, it’s good to get a head start on learning these important features before they make it into the C++ Standard.

Targeting the Windows Subsystem for Linux from Visual Studio

The Windows Subsystem for Linux (WSL) was first introduced at Build in 2016 and was delivered as an early beta in Windows 10 Anniversary Update. Since then, the WSL team has been hard at work, dramatically improving WSL’s abilty to run an ever increasing number of native Linux command-line binaries and tools,

Using C++ Resumable Functions with Libuv

Previously on this blog we have talked about Resumable Functions, and even recently we touched on the renaming of the yield keyword to co_yield in our implementation in Visual Studio 2017. I am very excited about this potential C++ standards feature,

Visual C++ for Linux 1.0.5 Updates

The Visual C++ for Linux announcement post has been updated with the content below. If you are already familiar with this extension this post covers what is new since our last update.

We recently posted new bits for our 1.0.5 release of the Visual C++ for Linux extension for Visual Studio 2015.

Visual C++ for Linux Updates

Updated 6/14/2016: We updated the original announcement post with the content below if you want a single page that covers everything about this extension. The below remains the same and just covers the updates from the original release.

Migration DevLab

Binary Compatibility and Pain-free Upgrade: Why Moving to Visual Studio 2017 is almost “too easy”

Visual Studio 2017 is a major leap forward in terms of C++ functionality compared with VS 2015. We hope the new release will delight you in your day-to-day job as soon as you can upgrade.

This blog post focuses on the steps needed to upgrade from Visual Studio 2015 to 2017.

Stuck on an older toolset version? Move to Visual Studio 2017 without upgrading your toolset

⏱ Updated on March 11, 2019 with the latest functionality in Visual Studio 2017
Are you currently developing your C++ projects in an older version of Visual Studio? If your reasons for avoiding the all-new features in VS 2017 are covered next,

Mobile

New Feature

Making C++ Exception Handling Smaller On x64

Visual Studio 2019 Preview 3 introduces a new feature to reduce the binary size of C++ exception handling (try/catch and automatic destructors) on x64. Dubbed FH4 (for __CxxFrameHandler4, see below), I developed new formatting and processing for data used for C++ exception handling that is ~60% smaller than the existing implementation resulting in overall binary reduction of up to 20% for programs with heavy usage of C++ exception handling.

Concurrency Code Analysis in Visual Studio 2019

Concurrency Code Analysis in Visual Studio 2019

The battle against concurrency bugs poses a serious challenge to C++ developers. The problem is exacerbated by the advent of multi-core and many-core architectures. To cope with the increasing complexity of multithreaded software,

Introducing the New CMake Project Settings UI

Visual Studio 2019 Preview 2 introduces a new CMake Project Settings Editor to help you more easily configure your CMake projects in Visual Studio. The editor provides an alternative to modifying the CMakeSettings.json file directly and allows you to create and manage your CMake configurations.

In-editor code analysis in Visual Studio 2019 Preview 2

The C++ team has been working to refresh the Code Analysis experience inside Visual Studio. Last year, we blogged about some in-progress features in this area. We’re happy to announce that in Visual Studio 2019 Preview 2, we’ve integrated code analysis directly into the editor,

Lifetime Profile Update in Visual Studio 2019 Preview 2

The C++ Core Guidelines’ Lifetime Profile, which is part of the C++ Core Guidelines, aims to detect lifetime problems, like dangling pointers and references, in C++ code. It uses the type information already present in the source along with some simple contracts between functions to detect defects at compile time with minimal annotation.

Out-of-Process Debugger for C++ in Visual Studio 2019

Visual Studio 2019 Preview 1 introduces an improved debugger for C++ that uses an external 64-bit process for hosting its memory-intensive components. If you’ve experienced memory-related issues while debugging C++ applications before, these issues should now be largely resolved with Visual Studio 2019.

New Start Window and New Project Dialog Experience in Visual Studio 2019

Two features available in Visual Studio 2019 Preview 1 for C++ developers are the start window and a revamped new project dialog. The start window moves the core features from the Visual Studio Start Page, which normally appeared in the editor space when Visual Studio is launched, out into a separate window that appears before the IDE launches. The window includes five main sections: Open recent, Clone or checkout code, Open a project or solution, Open a local folder, Create a new project. It is also possible to continue past the window without opening any code by choosing “Continue without code”. Let’s dig into the features of the start window.

AI-Assisted Code Completion Suggestions Come to C++ via IntelliCode

After reading and writing enough code, you begin to notice certain usage patterns. For example, if a stream is open, it will eventually be closed. More interestingly, if a string is used in the context of an if-statement, it will often be to check if the string is empty or if it has a certain size.

Announcing Live Share for C++: Real-Time Sharing and Collaboration

C++ developers using Visual Studio 2019 16.0 Preview 1 or Visual Studio Code can now use Live Share. With Live Share you can share the full context of your code, enabling collaborative editing and debugging. 

Collaborative Editing:

 

Collaborative Debugging: 

 

In a Live Share session there is a host and a guest(s).

Step Back – Going Back in C++ Time

Step Back for C++

In the most recent, 15.9, update to Visual Studio 2017 Enterprise Edition, we’ve added “Step Back” for C++ developers targeting Windows 10 Anniversary Update (1607) and later. With this feature, you can now return to a previous state while debugging without having to restart the entire process.

New User

Configuring C++ IntelliSense and Browsing

Whether you are creating a new (or modifying an existing) C++ project using a Wizard, or importing an project into Visual Studio from another IDE, it’s important to configure the project correctly for the IntelliSense and Browsing features to provide accurate information. 

C++ Tutorial: Hello World

Welcome to the C++ Tutorial.

In this first C++ tutorial, you will learn how to write (and run!) your first C++ program, “Hello, World!”. Along the way you will learn a little C++ history, see how to configure a C++ console application in Visual Studio 2017,

Bring your C++ code to Visual Studio

C++ has been around for a long time and throughout its history many tools have been built to make life easier for C++ developers. This has led to a diverse C++ ecosystem in terms of the editing tools, build systems,

Migrate your existing Windows C++ projects to MSBuild

If your project targets one of the Windows platforms only (Desktop or UWP), you should consider using MSBuild as your C++ build system. If you consider expanding beyond these platforms though, consider using CMake to specify your build. To learn more,

Bring your existing Android Eclipse projects to Visual Studio

You can use Visual Studio to develop your C++ projects targeting Android. To learn more about this support read the Visual C++ for Cross-Platform Mobile development section on MSDN.

If you’re currently using Eclipse and considering moving to Visual Studio,

Bring your existing C++ Linux projects to Visual Studio

Visual Studio supports targeting Linux out of the box – you can edit, remote build and remote debug to a Linux machine (whether that’s a remote machine, a VM running locally or in the cloud, or WSL in Windows 10).

Bring your existing Qt projects to Visual Studio

Qt framework is an ever growing cross-platform C++ framework, ideal for building desktop, mobile, and even embedded solutions. While you can use CMake to target Qt (if you do, you should read more about the Visual Studio support for CMake),

CMake support in Visual Studio

⏱ Updated on October 5, 2017 with the latest functionality included with Visual Studio 2017 15.4

Visual Studio 2017 introduces built-in support for handling CMake projects. This makes it a lot simpler to develop C++ projects built with CMake without the need to generate VS projects and solutions from the command line.

Bring your C++ codebase to Visual Studio with “Open Folder”

⏱ Updated on March 06, 2017 with the latest functionality in Visual Studio 2017 RTW

Welcome to Visual Studio 2017! Starting with this release, Visual Studio supports opening folders containing source code without the need to create any solutions or projects.

OpenFolder

Introducing the New CMake Project Settings UI

Visual Studio 2019 Preview 2 introduces a new CMake Project Settings Editor to help you more easily configure your CMake projects in Visual Studio. The editor provides an alternative to modifying the CMakeSettings.json file directly and allows you to create and manage your CMake configurations.

IntelliSense Enhancements for C++ Open Folder and CMake

Today’s preview of Visual Studio 2017 version 15.6 Preview 2 includes two IntelliSense improvements to streamline code editing for C++ Open Folder and CMake. We added a new type of IntelliSense squiggle to C++ Open Folder and CMake to streamline cross-platform development. 

Customizing your Environment with Visual C++ and Open Folder

点这里看中文版

Ever since we shipped support for opening a folder of C++ code, the community has been asking for more control over their build and editing environments.  To achieve this, we have added new ways to customize your environment with CppProperties.json in the latest version of Visual Studio 2017.

ARM GCC Cross Compilation in Visual Studio

点这里看中文版

⏱ Updated on January 10, 2018 to cover addition of debugging support in Visual Studio 2017 15.6

In Visual Studio 2017 15.5 we are introduced support for cross compilation targeting ARM microcontrollers.

Remote tasks in Visual Studio

We have introduced a new capability to run remote tasks in Visual Studio 2017 15.5 Preview 2.  This capability allows you to run any command on a remote system that is defined in Visual Studio’s Connection Manager.

CMake support in Visual Studio – CMake 3.9, Linux targeting, feedback

点这里看中文版

Visual Studio 2017 15.4 Preview 2 is now available and includes enhancements to Visual Studio’s CMake tools.  The latest preview upgrades CMake to version 3.9, includes better support for independent CMakeLists, and supports targeting Linux directly.

Using MinGW and Cygwin with Visual C++ and Open Folder

Building cross-platform C and C++ code is easier than ever with Visual Studio 15.3 Preview 4.  The latest preview improves support for alternative compilers and build environments such as MinGW and Cygwin.  MinGW (Minimalist GNU for Windows),

Bring your C++ code to Visual Studio

C++ has been around for a long time and throughout its history many tools have been built to make life easier for C++ developers. This has led to a diverse C++ ecosystem in terms of the editing tools, build systems,

Open any folder with C++ sources in Visual Studio 2017 RC

With the Visual Studio 2017 RC release, we’re continuing to improve the “Open Folder” capabilities for C++ source code. In this release, we’re adding support for building as well as easier configuration for the debugger and the C++ language services.

Bring your C++ codebase to Visual Studio with “Open Folder”

⏱ Updated on March 06, 2017 with the latest functionality in Visual Studio 2017 RTW

Welcome to Visual Studio 2017! Starting with this release, Visual Studio supports opening folders containing source code without the need to create any solutions or projects.

performance

Game performance and compilation time improvements in Visual Studio 2019

The C++ compiler in Visual Studio 2019 includes several new optimizations and improvements geared towards increasing the performance of games and making game developers more productive by reducing the compilation time of large projects. Although the focus of this blog post is on the game industry,

Visual Studio 2017 Throughput Improvements and Advice

点这里看中文版

As C++ programs get larger and larger and the optimizer becomes more complex the compiler’s build time, or throughput, increasingly comes into focus. It’s something that needs to be continually addressed as new patterns emerge and take hold (such as “unity”

MSVC code optimizer improvements in Visual Studio 2017 versions 15.5 and 15.3

In this post, we’d like to give you an update on the significant progress the Visual C++ code optimizer made in the past year, focused mostly on the features released in the 15.3 and 15.5 versions. Compared to VS2015 Update 3,

Faster C++ build cycle in VS 2017 with /Debug:fastlink

Continuing with our goal of further improving developer productivity with Visual Studio 2017 there have been major investments made for also improving incremental developer builds. The developer incremental build is one where a developer changes a single or multiple source files and builds.

Faster C++ solution load with VS 2017

The Visual C++ product has had projects ever since its inception.  Visual C++ had its own IDE up through Visual Studio 6.  Starting in Visual Studio .NET, C++ moved to a new IDE shared by Visual Basic, C#, C++, and other tools. 

Survey

Spring 2018 Visual C++ Migration Survey

The Spring 2018 Visual C++ Migration Survey is now open.

Please take a few minutes to share your experiences, positive or not so positive. If you have not migrated your solutions and project to Visual Studio 2017, please let us know why. 

vcpkg 3 Months Anniversary, Survey

vcpkg, a tool to acquire and build C++ open source libraries on Windows, was published 3 months ago. We started with 20 libraries and now the C++ community has added 121 new C++ libraries. We really appreciate your feedback and we created a survey to collect it.

C++ code analysis: tell us what you think!

We’d love to hear more about what you would like to see in C++ code analysis. We’re running a short survey–just 20 questions–to help us understand how to make C++ code analysis and Visual C++ better.

Please take a couple of minutes to fill out our C++ Code Analysis survey and let us know your thoughts.

C++ Unit Testing Survey (Summer 2016)

Hi everyone! The Visual Studio C++ team is conducting a survey to learn more about your C++ unit testing experiences. We’ll use the feedback to make improvements to Visual Studio in the future. The survey should take less than 10 minutes to complete.

Visual C++ for Linux Updates

Updated 6/14/2016: We updated the original announcement post with the content below if you want a single page that covers everything about this extension. The below remains the same and just covers the updates from the original release.

Do You Develop Games?

Or have you worked on a game recently?
If so, please share some details about your experience. The Microsoft Visual Studio team would like to learn more about your current game development experience. The survey should take less than ~10 minutes.

Uncategorized

Using VS Code for C++ development with containers

This post builds on using multi-stage containers for C++ development. That post showed how to use a single Dockerfile to describe a build stage and a deployment stage resulting in a container optimized for deployment. It did not show you how to use a containers with your development environment.

What’s New in CMake – Visual Studio 2019 Preview 2

We have made a bunch of improvements to Visual Studio’s CMake support in the latest preview of the IDE. Many of these changes are taking the first steps to close the gap between working with solutions generated by CMake and the IDE’s native support.

Visual Studio Code C++ extension: October 2018 update and a simplified Insiders program

The October 2018 update of the Visual Studio Code C++ extension has recently shipped. It comes with a ton of bug fixes, improved Go to Definition support, integrated terminal support when debugging, and a simpler way to opt into our extension’s Insiders program.

Exploring Clang Tooling – Using Build Tools with clang-tidy

This post is part of a regular series of posts where the C++ product team and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

Q&A: How to specialize std::sort by binding the comparison function

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: Visual C++, the standard language and library,

std::string_view: The Duct Tape of String Types

Visual Studio 2017 contains support for std::string_view, a type added in C++17 to serve some of the roles previously served by const char * and const std::string& parameters. string_view is neither a “better const std::string&”, nor “better const char *”;

Support for Unity (Jumbo) Files in Visual Studio 2017 15.8 (Experimental)

This post was written by Olga Arkhipova.

Many big codebases use so-called unity (jumbo) builds where many source files are included in one or a few ‘unity’ files for compilation, which makes compiling and linking much faster.

Announcing C++ Just My Code Stepping in Visual Studio

In Visual Studio 2017 release 15.8 Preview 3 we’re announcing support for Just My Code stepping for C++. In addition to previously supported callstack filtering, the Visual Studio debugger now also supports stepping over non-user-code. As you “Step In”,

New, experimental code analysis features in Visual Studio 2017 15.8 Preview 3

The Visual C++ team has been working to refresh our code analysis experience inside Visual Studio. We’re aiming to make these tools both more useful and natural to use and hope that they’ll benefit you no matter your workflow, style,

Convert Macros to Constexpr

Visual Studio 2017 version 15.8 is currently available in preview. Today, Preview 3 has been released, and it comes with several features that improve the developer productivity experience. One key theme in 15.8 is code modernization, and macros are a key target for that.

VC++ Migration Documentation

Binary Compatibility and Pain-free Upgrade: Why Moving to Visual Studio 2017 is almost “too easy”

Visual Studio 2017 is a major leap forward in terms of C++ functionality compared with VS 2015. We hope the new release will delight you in your day-to-day job as soon as you can upgrade.

This blog post focuses on the steps needed to upgrade from Visual Studio 2015 to 2017.

Visual C++ 2015 and 2017 Migration Documentation Update

Upgrading to the latest C++ compiler and toolset is sometimes not so easy and can be time consuming. You are likely to encounter some compiler and linker errors and warnings in code that previously compiled cleanly. There are several possible sources for these errors,

Stuck on an older toolset version? Move to Visual Studio 2017 without upgrading your toolset

⏱ Updated on March 11, 2019 with the latest functionality in Visual Studio 2017
Are you currently developing your C++ projects in an older version of Visual Studio? If your reasons for avoiding the all-new features in VS 2017 are covered next,

Vcpkg

Using multi-stage containers for C++ development

Containers are a great tool for configuring reproducible build environments. It’s fairly easy to find Dockerfiles that provide various C++ environments. Unfortunately, it is hard to find guidance on how to use newer techniques like multi-stage builds. This post will show you how you can leverage the capabilities of multi-stage containers for your C++ development.

Use the official Boost.Hana with MSVC 2017 Update 8 compiler

We would like to share a progress update to our previous announcement regarding enabling Boost.Hana with MSVC compiler. Just as a quick background, Louis Dionne, the Boost.Hana author, and us have jointly agreed to provide a version of Boost.Hana in vcpkg to promote usage of the library among more C++ users from the Visual C++ community.

Use Boost.Hana via vcpkg with the latest MSVC compiler

Overview

As we continue to work towards improving the conformance of the MSVC compiler for the C++ community, we would like to enable more C++ libraries, and today we are bringing Boost.Hana to Visual C++.  Building on our recent C++ conformance progress,

Announcing a single C++ library manager for Linux, macOS and Windows: Vcpkg

At Microsoft, the core of our vision is “Any Developer, Any App, Any Platform” and we are committed to bringing you the most productive development tools and services to build your apps across all platforms. With this in mind, we are thrilled to announce today the availability of vcpkg on Linux and MacOS.

Vcpkg: introducing installation options with Feature Packages

We are happy to announce a new feature for vcpkg in version 0.0.103: Feature Packages.

Vcpkg is a package manager to help acquiring and building open source libraries on Windows; vcpkg currently offers over 600 C++ libraries available for VS2017 and VS2015.

Vcpkg: Introducing the upgrade command

If you’re just getting started and want to learn more about vcpkg, check out our initial post.

We recently added a new option to vcpkg (i.e. vcpkg contact –survey) to provide a direct way to share your feedback with the Vcpkg team.

Vcpkg: Using multiple enlistments to handle multiple versions of a library

Vcpkg allows you to acquire and build 3rd party libraries on Windows. Once cloned, the vcpkg directory (enlistment) provides a stable set of libraries that are all compatible and based on the latest published version of these libraries.

Vcpkg: introducing export command

Vcpkg helps you acquire and build open source libraries on Windows. Since September 2016, the community added more than 200 libraries in the vcpkg catalog and has been contributing actively to the code itself. Vcpkg now supports Visual Studio 2015 and Visual Studio 2017 and can target dynamic or static libraries and platforms like x64,

Binary Compatibility and Pain-free Upgrade: Why Moving to Visual Studio 2017 is almost “too easy”

Visual Studio 2017 is a major leap forward in terms of C++ functionality compared with VS 2015. We hope the new release will delight you in your day-to-day job as soon as you can upgrade.

This blog post focuses on the steps needed to upgrade from Visual Studio 2015 to 2017.

Vcpkg recent enhancements

Vcpkg simplifies acquiring and building open source libraries on Windows. Since our first release we have continually improved the tool by fixing issues and adding features. The latest version of the tool is 0.0.71, here is a summary of the changes in this version:

  • Add support for Visual Studio 2017
  • VS2017 detection
  • Fixed bootstrap.ps1 and VS2017 support
  • If both Visual Studio 2015 and Visual Studio 2017 are installed,

Visual Studio Code

Visual Studio Code C/C++ extension: January 2019 Update

The January 2019 update of the Visual Studio Code C++ extension is now available. This release includes many new features and bug fixes including documentation comments support, improved #include autocomplete performance, better member function completion, and many IntelliSense bug fixes.

Visual Studio Code C/C++ extension August 2018 Update

Late last week we shipped the August 2018 update  to the C/C++ extension for Visual Studio Code. This update included support for “Just My Code” symbol search, a gcc-x64 option in the intelliSenseMode setting, and many bug fixes.

C++ development with Docker containers in Visual Studio Code

Containers allow developers to package up an application with all the parts it needs, such as libraries and other dependencies, and ship it all out as one image. This is especially useful for C++ cross-platform development – with containers you can choose to target a platform that runs on a completely different operating system than your developer machine.

Visual Studio Code C/C++ extension July 2018 Update and IntelliSense auto-configuration for CMake

Last week we shipped the July 2018 update to the C/C++ extension for Visual Studio Code. In this update we added support for a new experimental API that allows build system extensions to pass IntelliSense configuration information to our extension for powering up full IntelliSense experience.

Visual Studio Code C/C++ extension June 2018 Update

Visual Studio Code C/C++ extension June 2018 Update

Today we’re very happy to announce the availability of the June 2018 update to the C/C++ extension for Visual Studio Code! In this update, we are continuing our efforts to make IntelliSense configuration easier by auto-detecting compile_commands.json files for IntelliSense,

Visual Studio Code C/C++ extension May 2018 Update – IntelliSense configuration just got so much easier!

Visual Studio Code C/C++ extension May 2018 Update – IntelliSense configuration just got so much easier!

This morning we shipped the May 2018 update of the C/C++ extension for Visual Studio Code, the most significant update to this extension in its 2-year history!

Visual Studio Code C/C++ extension March 2018 update

Today we are excited to announce the March 2018 update to the Visual Studio Code C/C++ extension! This update includes improved auto-complete for local and global scopes and a simplified configuration process for system includes and defines,

Visual Studio Code C/C++ extension Feb 2018 update

点这里看中文版

The February 2018 update to the Visual Studio Code C/C++ extension is here! In addition to several bug fixes, this update added colorization for inactive code regions, making it easy to read C and C++ code.

Visual Studio Code C/C++ extension Jan 2018 update

点这里看中文版

Today we are shipping the first update of the year to the Visual Studio Code C/C++ extension! This update includes IntelliSense and code navigation performance improvements and a CPU Usage setting for the tag parser to specify the CPU resources to be used.

Visual Studio Code C/C++ extension Dec 2017 update – support for more Linux distros

Happy holidays! Today we’re shipping the December 2017 update to the Visual Studio Code C/C++ extension – our last major update of this year, with out-of-box support for more Linux distros and built-in guidance on how to configure for a better IntelliSense experience.

Writing Code

std::optional: How, when, and why

This post is part of a regular series of posts where the C++ product team here at Microsoft and other guests answer questions we have received from customers. The questions can be about anything C++ related: MSVC toolset, the standard language and library,

C++ Core Checks in Visual Studio 2017 15.7 Preview 2

This post was written by Sergiy Oryekhov.

The C++ Core Guidelines Check extension received several new rules in Visual Studio 2017 15.7 Preview 2. The primary focus in this iteration was on the checks that would make it easier to adopt utilities from the Guidelines Support Library.

C++ Code Analysis Improvements for Visual Studio 2017 15.7 Preview 1

点这里看中文版

We’re making it easier to configure and use the C++ code analysis features with a set of changes targeting 15.7. In the first 15.7 preview we’ve cleaned up the UI, fixed our documentation links and,

Arithmetic overflow checks in C++ Core Check

点这里看中文版

We’ve improved the C++ Code Analysis toolset with every major compiler update in Visual Studio 2017. Version 15.6, now in Preview, includes a set of arithmetic overflow checks. This article discusses those checks and why you’ll want to enable them in your code.

Diagnostic Improvements in Visual Studio 2017 15.3.0

This post as well as described diagnostics significantly benefited from the feedback by Mark, Xiang, Stephan, Marian, Gabriel, Ulzii, Steve and Andrew.

Visual Studio 2017 15.3.0 release comes with a number of improvements to the Microsoft Visual C++ compiler’s diagnostics.

Building your C++ application with Visual Studio Code

Over the last few months, we have heard a lot of requests with respect to adding capability to Visual Studio Code to allow developers to build their C/C++ application. The task extensibility in Visual Studio Code exists to automate tasks like building,