下载第二个ubuntu /arm 系统:Download Visual Studio Code - Mac, Linux, Windows
dpkg -i 安装包
sudo dpkg -i code_1.60.1-1631294805_amd64.deb
1.sudo gedit /usr/bin/code
修改ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"为:
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" --user-data-dir=/sd_card/usr_dev/Code
2.sudo gedit /usr/share/applications/code.desktop
修改Exec=/usr/share/code/code --unity-launch %F为:
Exec=/usr/share/code/code --unity-launch --user-data-dir=/sd_card/usr_dev/Code %F
修改Exec=/usr/share/code/code --new-window %F为:
Exec=/usr/share/code/code --new-window --user-data-dir=/sd_card/usr_dev/Code %F
Ctrl+shift+p:launch
launch.json
{
// 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}/hello",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
ctrl+shift+p:tasks
tasks.json
c++
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build demo1", //任务标签
"type": "shell", //类型
"command": "g++", //对应的命令:g++ -g demo1.cpp -o demo
"args": [
"-g",
"hello.cpp",
"-o",
"hello"
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
cmake
{
"tasks": [
{
//Ctrl + Shift + p 打开命令行,键入关键字 "task",并在下拉菜单中选择 Tasks: Configure Default Build Task -> Create tassk.json file from template -> Others
"label": "make build",
"type": "shell",
"command": "cd ./build;cmake ..;make", //编译时执行的程序
"group": {
"kind": "build",
"isDefault": true
},
},
{
"label": "clean",
"type": "shell",
"command": "make clean",
}
],
"version": "2.0.0"
}
ctrl+shift+p:c/c++
c_cpp...json
{
"configurations": [
{
"name": "Linux", //环境名 Ctrl + Shift + p 打开命令行,键入关键字 "C++",在下拉菜单中选择 "C/C++ Edit configuration",系统即自动在 .vscode 目录下创建 c_cpp_properties.json 文件
"includePath": [
"include/**", //头文件目录
"/usr/include",
"/usr/local/include",
"/usr/local/include/opencv4"
],
"defines": [],
"compilerPath": "/usr/bin/g++", //编译器的路径,可根据自己的安装情况进行设置 gcc c程序 ,g++ c++
"cStandard": "c11", //c++标准
"cppStandard": "c++17", //设置使用的 C/C++ 标准
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
编译:ctrl+shift+b
运行:F5