Ubuntu18.04搭建VSCode编译环境

# 确认ubuntu 18.04
uname -a

# 添加root帐户密码:
sudo passwd root

 第一步:配置C++编译环境

# 安装gcc 和 g++
gcc -v
g++ -v
sudo apt install gcc
sudo apt install g++

先写一个helloworld.cpp,

#include <iostream>

int main()
{
    printf("Hello World\n");
    return 0;
}

手工编译能编译通过。

# 编译
g++ hello.cpp -o hello
# 运行
./helloworld

第二步:安装VSCode及插件

VSCode IDE:官网下载安装即可

启动VSCode,先把VSCode环境改为中文,在扩展中搜索chinese,安装重启VSCode即可。

进行必要的设置(settings.json直接添加):

{
    "files.autoGuessEncoding": true,// 自动识别字符编码
    "editor.renderControlCharacters": true, // 显示空格符
    "editor.renderWhitespace": "all",
    "editor.fontSize": 15,// 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值