VSCode build debugging environment based on the C ++ programming language to build guide

1. Local environmental settings

Compiled C ++ program that requires C ++ compiler, I recommend using mingw-W64 , which is Windows commonly used to compile the system environment, you can download the official website ( ming-W64 ) .

Set the environment variable :

Computer -> Properties -> Advanced System Settings -> Environment Variables

 

 

 

System variables Path, edit added.

 

 

 

 

Then enter the terminal input gcc -v, following on the success.

 

 

 

2.VS Code Set

  VS Code of the terminal is equivalent to the Windows of cmd , where you can perform Windows all operations command can be executed, you can use here mingw compiled program, which is to build C ++ provides a viable program debugging environment .

Before the formal start debugging, you also need to install C / C ++ plug-ins to better support C ++ programming and debugging, in Extensions search in C ++ you can;

 

 

 

 

3. Compile the test

Create a folder, and create a test.cpp file.

 

 

 

 

 

 

Press F5 appears, select C ++ (GDB / LLDB).

 

 

 

 

 

 

Select g ++. Exe. Generate launch.json file.

 

 

 

There will be a tasks.json file.

 

 

 

F5 final test.

 

 

Guess you like

Origin www.cnblogs.com/buzhidao1/p/12611804.html
Recommended