赞
踩
目录
实现两系统之间的跨系统复制粘贴
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop
最后重启ubtuntu系统
在主机Windows系统下载vscode
下载链接
http://Visual Studio Code - Code Editing. Redefined
下载Linux x64.deb版本 到桌面即可
将其拖入ubuntu的下载文件夹中
双击上面安装包安装
安装完成后打开vscode,终端输入code回车
打开终端分别输入以下命令安装vim和g++
sudo apt-get install vim
sudo apt install g++
安装第一个即可,安装完成后重启软件
汉化成功
vscode打开code文件夹,新建main.cpp文件
会报错,不要慌,进入launch.json文件
- #include<iostream>
- using namespace std;
-
- int main()
- {
-
- cout <<"hello vscode"<<endl;
- system("pause");
- return 0;
-
- }
运行后会生成.vscode文件,文件中包含launch.json和task.json文件
修改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"]
- }
- ]
- }
回到main.cpp程序重新运行
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。