Article Directory
Preface
Used to get familiar with vs code under llinux for future use.
The following is the text of this article, reference: Station B: Goose bomb
1. How to install vscode?
Reference link: https://blog.csdn.net/ll596214569/article/details/106445990
Second, the compilation process
1. Create a workspace
The code is as follows (enter in the terminal):
Find the folder you want to put, open the terminal, and enter the following code.
mkdir EIGEN
code ./EIGEN
Get this workspace.
Install plugin: C++
2. C++ debugging
Create a .cpp file (note: the file type is related to the file name suffix).
Just write a C++ program
#include<iostream>
#include<string>
using namespace std;
int main(int argc,char **argv )
{
cout<<"hello ltt"<<endl;
return 0;
}
Create launch.json file
Environment selection: C++ (GDB/LLDB)
Then select g++ build and debug active file to get the .json file.
Create the task.json file (sequentially)
1. Go back to the .cpp file
2. ctrl+shift+p or F1 to open the command bar
3.tasks: Configure Task
4.C/ C++: g++ build active file
5. Get the result shown in the figure below
Join in the tasks.json file
"-std=c++17"
The location is as follows.
Then return to the cpp file and add a breakpoint. F5 runs.
Add an option in the launch.json file
"internalConsoleOptions": "neverOpen",
In the blue position in the figure below:
return to find that the debugging is successful;