亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

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

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

一、主機windows與虛擬機Ubuntu聯(lián)動

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

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

在主機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.漢化

安裝第一個即可,安裝完成后重啟軟件

漢化成功

3.安裝拓展C/C++

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

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

5. 輸入程序并運行

會報錯,不要慌,進入launch.json文件

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

運行后會生成.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.最終運行成功

回到main.cpp程序重新運行

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

相關文章

最新評論