Article Directory
One, install vscode
Two, install the plug-in and configure the c\c++ compilation environment
1. Install the following two plugins
2. Configure the compilation environment
One, install mingw64 (recommended)
method one
-
It is recommended to use the mingw64 of devc++ to find the installation directory of devc++ and open it to find
-
Configure environment variables
-
verification
Method Two
Download and install mingw64 from the official website (not recommended, anyway, I failed). If you don't want to use devc++, you can download and install first, copy mingw64 to the specified location and configure environment variables for it, and then uninstall devc++.
The verification method is the same as above
2. If you have installed visual studio, you can use Microsoft's msvc
Still not recommended, but you can try
3. Write the configuration file
-
Create an empty folder anywhere
-
Use vscode to open the folder and write a hello.cpp
#include <iostream> using namespace std; int main() { cout << "hello world"; return 0; }
-
ctrl + shift + p
-
Editor path
-
IntelliSense mode
-
At this time, there will be an extra .vscode folder in the directory
-
Open hello.cpp, enter ctrl + shift + p , and create an extra file named tasks.json in the .vscode folder
-
Found another file launch.json under .vscode, change it as follows
-
4. Test ctrl + F5
Found that the console window flashed by, in fact, it has been successful, if you want to stop it, you can add a cin statement
At this point, we can save the .vscode folder and copy it directly when needed (in fact, the operation is very simple, almost no changes, you can use the above steps)
Attach my .vscode folder, if it is unsuccessful, you can change the path with cv