ubuntu安装VSC
时间: 2023-10-17 09:36:07 浏览: 144
在Ubuntu中安装VSCode并配置C/C++开发环境的方法步骤
要在Ubuntu上安装VSCode,可以按照以下步骤进行操作:
1. 首先,下载VSCode的安装文件。你可以从VSCode官方网站下载最新的.deb安装包。
引用:传送门
```
# offline
sudo dpkg -i code_1.25.1-1531323788_amd64.deb
# online
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64 https://packages.microsoft.com/repos/vscode stable main"
sudo apt update
sudo apt install code
```
2. 安装完成后,可以通过搜索或在终端中输入"code"来打开VSCode。
3. 如果你希望在VSCode中使用中文界面,可以进行以下配置:
引用:Ubuntu下Vscode调试出现无法打开"libc-start.c" 在gnu官网找到对应的glibc下载解压到/build/xxx对应文件中 。
引用:ctrl shift P打开Command Palette,运行"C/Cpp: Edit configurations…"。然后在打开的"c_cpp_properties.json"文件中进行以下配置:
```
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/include/",
"/usr/local/include/opencv4" //opencv路径
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "gnu14",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
```
4. 至此,VSCode已成功安装并配置完成。你可以使用Ctrl+Shift+B键进行编译,使用F5或从主菜单中选择"Run" > "Start Debugging"来开始调试。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [ubuntu之VScode](https://blog.csdn.net/zhayushui/article/details/102457583)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文