文章目录
- 实现两系统之间的跨系统复制粘贴 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系统
- 1.下载vscode 全能代码编辑器Visual Studio Code for Mac M1芯片 v1.91.0 官方中文版 类型:开发软件 大小:124MB 语言:简体中文 时间:2024-07-11 查看详情 Visual Studio Code(代码编辑器) v1.96.2 64位 中文免费绿色版 类型:编译工具 大小:140MB 语言:简体中文 时间:2024-12-23 查看详情 在主机Windows系统下载vscode。 下载Linux x64.deb版本到桌面即可。 将其拖入ubuntu的下载文件夹中。 2.安装 双击上面安装包安装 安装完成后打开vscode,终端输入code回车
- 1.g++配置 打开终端分别输入以下命令安装vim和g++ sudo apt-get install vim sudo apt install g++ 2.汉化 安装第一个即可,安装完成后重启软件 汉化成功 3.安装拓展C/C++ 4.创建项目文件夹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系统下成功配置VSCode。
Ubuntu系统中需要安装VSCode,该怎么下载安装并进行配置呢?下面我们一起来看看。
实现两系统之间的跨系统复制粘贴
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系统
1.下载vscode

全能代码编辑器Visual Studio Code for Mac M1芯片 v1.91.0 官方中文版
- 类型:开发软件
- 大小:124MB
- 语言:简体中文
- 时间:2024-07-11
查看详情

Visual Studio Code(代码编辑器) v1.96.2 64位 中文免费绿色版
- 类型:编译工具
- 大小:140MB
- 语言:简体中文
- 时间:2024-12-23
查看详情
在主机Windows系统下载vscode。

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

将其拖入ubuntu的下载文件夹中。


2.安装
双击上面安装包安装

安装完成后打开vscode,终端输入code回车


1.g++配置
打开终端分别输入以下命令安装vim和g++
sudo apt-get install vim sudo apt install g++
2.汉化

安装第一个即可,安装完成后重启软件

汉化成功
3.安装拓展C/C++

4.创建项目文件夹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系统下成功配置VSCode。