1.下载sublime text3

官网地址:http://www.sublimetext.com/3
ubuntu直接在Ubuntu Software中搜索sublime安装

2.配置环境变量(windows)

下载Mingw放到C盘,path路径设为`C:\MinGW\bin`
在cmd中输入`g++ -v`或`gcc -v`判断路径是否设置成功,path路径在电脑重启后生效

3.设置package control

在控制台中加入一下网址的代码
https://packagecontrol.io/installation

4.配置编译运行文件

在windows下的编译配置文件(支持c++11)

{
"encoding": "cp936",
"working_dir": "$file_path",
"shell_cmd": "g++ -Wall -std=c++11 -fexec-charset=GBK $file_name -o $file_base_name",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"selector": "source.c++", "variants":
[
{
"name": "Run",
"shell_cmd": "g++ -Wall -fexec-charset=utf-8 \"$file\" -o \"$file_base_name\" && start cmd /c \"\"${file_path}/${file_base_name}\" & pause\""
}
]
}

用c编译的话只需用gcc替换上述代码的g++即可`

在ubuntu下的编译配置文件(支持c++11)

{
"shell_cmd": "g++ '-std=c++11' '${file}' -o '${file_path}/${file_base_name}'",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++", "variants":
[
{
"name": "Build & Run",
"shell_cmd": "x-terminal-emulator -e bash -c \"g++ '-std=c++11' '${file}' -o '${file_path}/${file_base_name}' ; '${file_path}/${file_base_name}' ; read -p '\nPress ENTER or type command to continue...'\""
}, {
"name": "Build Only",
"shell_cmd": "g++ '-std=c++11' '${file}' -o '${file_path}/${file_base_name}'"
}, {
"name": "Run Only",
"shell_cmd": "x-terminal-emulator -e bash -c \"'${file_path}/${file_base_name}' ; read -p '\nPress ENTER or type command to continue...'\""
}
]
}

5.参考

https://www.cnblogs.com/kearon/p/7354888.html

最新文章

  1. 深入理解android:id以及@+id/name和@id/name的区别联系
  2. windows下virtualbox安装Ubuntu虚拟机
  3. ReportViewer内存泄漏问题解决方案[上]
  4. loadrunner比较有用的字符串函数
  5. VS下的Resharper插件报错“Can not resolve symbol”的解决办法
  6. Linux下vi编辑器粘贴复制剪切功能
  7. POJ 1785 Binary Search Heap Construction(裸笛卡尔树的构造)
  8. 解决无法获取 GridView 隐藏列值问题
  9. C#中子窗体获取父窗体中控件的内容
  10. Open Replicator
  11. xxx==null和xxx.equals(null)的区别
  12. 包(package)以及面向对象三个基本特征(继承)的介绍
  13. docker 14 dockerfile自定义mycentos
  14. 1000. A+B Problem
  15. A*算法详解链接
  16. 后端解决 微信H5支付 商户参数格式错误 方法
  17. [CocoaPods]使用CocoaPods进行测试
  18. GNU Binutils简介及基本用法
  19. uniGUI试用笔记(九)
  20. 把springboot的项目打包运行指南

热门文章

  1. C#模拟登录Twitter 发送私信、艾特用户、回复评论
  2. The user's guide what comes in the kernel Documentation directory
  3. 关于 underscore 中模板引擎的应用演示样例
  4. npm的常用配置
  5. java设计模式----其他模式
  6. C++类使用static小例子(新手学习C++)
  7. Chrome浏览器V43版本号不支持silverlight 5.0的解决的方法
  8. 【HDU 5384】Danganronpa(AC自己主动机)
  9. PowerDesigner逆向工程,从SQL Server数据库生成Physical Model
  10. Java程序员从笨鸟到菜鸟之(十五)Html基础积累总结(下)