Windows下的Ubuntu,vscode 开发cpp

版权声明:此文章版权归呆呆所有,转发请注明出处! https://blog.csdn.net/zhangyu4863/article/details/83932425

安装ubuntu

这个简单,app store有,百度安装就好

ubuntu中安装编译器

  • gcc
    • sudo apt-get update
    • apt-get install gcc
    • gcc --version 测试
  • g++
    • sudo apt install g++
    • apt-get install g++
    • g++ --version 测试
➜  /home cat test.cpp
/*************************************************************************
        > File Name: test.cpp
        > Author:
        > Mail:
        > Created Time: Sat Nov 10 18:36:34 2018
 ************************************************************************/

# include<stdio.h>

#include<iostream>
using namespace std;

int main(){
    printf("hello!\n");
    return 0;
}
➜  /home g++ test.cpp
➜  /home ls
a.out  test.cpp
➜  /home ./a.out
hello!

使用

编辑的时候使用vscode打开对应文件即可
编译的时候使用ubuntu命令行编译就好

毕竟比较懒,懒得配置vscode

猜你喜欢

转载自blog.csdn.net/zhangyu4863/article/details/83932425