download:
Install:
sudo dpkg -i code_1.80.0-1688479026_amd64.deb
To install vscode plug-in, please refer to: Install VS Code and C/C++ plug-in under Ubuntu (creation of PS working directory) 3. Throw the installation package into Ubuntu or download it in the Ubuntu browser 4. Install 5. Put the installed VScode icon on the desktop 6. Double-click to open the C/C++ plug-in collection 1. Enter the plug-in store and select the plug-in 2. There is a fee for installing the plug-in Source Insight, which is not suitable for use in many occasions, and Visual Studio Code is more powerful and free, and there are still many Source Insight bugs. In addition, Visual Studio Code can directly download Ubuntu https://blog.csdn.net/zhuguanlin121/article/details/118787791
Create a working directory, the project directory.
Create a demo.cpp test file in the working directory
Then configure the cpp compiler path: shortcut key ctrl+shift+p, then enter edit config, select json
Can refer to:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++14",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}
Then add the following content yourself:
"/usr/include/**",
"/usr/local/include/**"
write test code
#include <iostream>
int main()
{
std::cout << "hello" << std::endl;
}