欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Ubuntu怎么安裝vscode? Ubuntu下vscode安裝調(diào)試圖文教程

  發(fā)布時(shí)間:2024-12-25 15:12:30   作者:佚名   我要評(píng)論
在Ubuntu系統(tǒng)下配置Visual Studio Code(VSCode)主要涉及安裝VSCode、安裝必要的插件以及進(jìn)行一些基本的設(shè)置,以下是一個(gè)詳細(xì)的步驟指南

Ubuntu系統(tǒng)中需要安裝VSCode,該怎么下載安裝并進(jìn)行配置呢?下面我們一起來看看。

一、主機(jī)windows與虛擬機(jī)Ubuntu聯(lián)動(dòng)

實(shí)現(xiàn)兩系統(tǒng)之間的跨系統(tǒng)復(fù)制粘貼

1.打開終端

2.分別輸入命令

sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop

最后重啟ubtuntu系統(tǒng)

二、安裝vscode

1.下載vscode

在主機(jī)Windows系統(tǒng)下載vscode。

下載Linux x64.deb版本到桌面即可。

將其拖入ubuntu的下載文件夾中。

2.安裝

雙擊上面安裝包安裝

安裝完成后打開vscode,終端輸入code回車

三、配置環(huán)境

1.g++配置

打開終端分別輸入以下命令安裝vim和g++

sudo apt-get install vim
sudo apt install g++

2.漢化

安裝第一個(gè)即可,安裝完成后重啟軟件

漢化成功

3.安裝拓展C/C++

4.創(chuàng)建項(xiàng)目文件夾code

vscode打開code文件夾,新建main.cpp文件

5. 輸入程序并運(yùn)行

會(huì)報(bào)錯(cuò),不要慌,進(jìn)入launch.json文件

#include<iostream>
using namespace std;
int main()
{
  cout <<"hello vscode"<<endl;
  system("pause");
  return 0;
}

運(yùn)行后會(huì)生成.vscode文件,文件中包含launch.json和task.json文件

6.修改文件程序

修改launch.json文件如下,直接覆蓋即可

// An highlighted block
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
        "name": "(gdb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/${fileBasenameNoExtension}.out",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": true,
        "MIMode": "gdb",
        "preLaunchTask": "build",
        "setupCommands": [
            {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
            }
        ]
    }
    ]
}

修改task.json文件如下,直接覆蓋即可

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
    {
    "label": "build",
    "type": "shell",
    "command": "g++",
    "args": ["-g", "${file}", "-std=c++11", "-o", "${fileBasenameNoExtension}.out"]
    }
    ]
   }

7.最終運(yùn)行成功

回到main.cpp程序重新運(yùn)行

通過遵循以上步驟,你應(yīng)該能夠在Ubuntu系統(tǒng)下成功配置VSCode。

相關(guān)文章

最新評(píng)論