"Reprint" under Windows Vscode compiled debug C + +

Source: Internet
Author: User

Lazy to configure themselves or their own configuration of unknown problems can be a friend point here:
"Vscode" Windows under Vscode portable C + + Environment
http://blog.csdn.net/c_duoduo/article/details/52083494
Download and extract to eat.

This article is reproduced from http://www.2cto.com/kf/201606/516207.html

The original text reads as follows:

This article is a super-detailed procedure for Blackkitty documenting the Debug/C + + process using Vscode compilation under Windows

First look at the effect
Set breakpoints, variable monitoring, view of call stacks:

Use of conditional breakpoints:

Here is the configuration process:

Overall process:

    1. Download and install Vscode
    2. Installing the Cpptools Plugin
    3. Installing the compilation and debugging environment
    4. Modifying the Vscode Debug configuration file
    5. Finished

Download and install Vscode
Https://code.visualstudio.com/Download

Click to download the appropriate version of your favorite, the green version of the extract can be eaten

Installing the Cpptools Plugin
Open Vscode, press Ctrl+e to open the Quick Command box, and then wait until you enter the following command

Ext Install Cpptools

Vscode lists the plug-in list after a short network lookup,

Click the button at the arrow to install the plug-in, the installation process may be a bit slow and patient waiting
After the installation is complete, Vscode will prompt you to restart the Vscode, at this time restart

Installing the compilation and debugging environment

Currently debugging under Windows only supports Cygwin and MinGW.
The MinGW is used here.
Here is the installation configuration process for MinGW:
http://mingw.org/
Enter the official dot click on the right Download installer download Installer
Open the installer and click Install to prepare the installation:

Select an installation directory, default to C:\MinGW here is the A:\MinGW
Click Continue to start the installation, the installation process needs to be networked, if the installation prompt error will need to FQ installation
The installation process is quick, and after the Continue button is restored to a usable state, click Finish installation.


Open MinGW Setup Manager for further configuration


Select several required items right-click make for installation to mark, where GCC and g++ are C and C + + compilers
Select the full part you want to install after clicking on the upper left corner of the installation menu under the Apply Changes application modification, the process needs networking, the middle of error can continue, if the final failure will need to FQ update, recommended FQ

Then configure the system environment variable path, which is a step that must be
Right-click Properties on My Computer:
Then follow the steps below and note that the last item to be created corresponds to the previous MinGW installation location

Modifying the Vscode Debug configuration file
Open Vscode Again, note configure the System environment variable path and reboot Vscode
Note Vscode debugging needs to be done in an open folder

After opening the folder, create a new test.cpp to enter the code test:

Enter the debug interface to select C + +:

A Launch.json startup configuration file is then generated in the working directory:

Replace the file with the following code:

View Code

Note that the Midebuggerpath will correspond to the path of the MinGW
After replacing save, then switch to Test.cpp, press F5 to debug, this will pop up an information box asks you to configure the task to run the program, click it ~

Here's a casual choice:

Then replace it with the following code:

View Code

Save it, then switch to Test.cpp, press F5 again to start debugging ~

Finished!

"Reprint" under Windows Vscode compiled debug C + +

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.