ubuntu20.04 configuration vscode

download:

https://az764295.vo.msecnd.net/stable/660393deaaa6d1996740ff4880f1bad43768c814/code_1.80.0-1688479026_amd64.debhttps://az764295.vo.msecnd.net/stable/660393deaaa6d1996740ff4880f1bad43768c814/code_1.80.0-1688479026_amd64.deb

 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:

Add Eigen library to vscode under Ubuntu (vscode reports error to eigen library to solve) I use KDdevelop in my book, and I have a soft spot for vscode and want to learn on it-it's over when I die. If you encounter the problem that vscode reports an error to the eigen library, please pull it directly below. 1. Now terminal mkdir (folder name), then cd (folder name), then code. Open vscode. 2. Create CMakeLists.txt yourself, and then write the following cmake_minimum_required (VERSION 3.16.3) proj https://blog.csdn.net/qq_41949101/article/details/119190704 to automatically generate content c_cpp_properties.json:

{
    "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;
}

 

Guess you like

Origin blog.csdn.net/jizhidexiaoming/article/details/131685913