首先安装mingw,mingw是gnu在windows下的一个实现,对于咱们这个需求,比用cygwin更加合适c++
官网以下说windows
MinGW compilers provide access to the functionality of the Microsoft C
runtime and some language-specific runtimes. MinGW, being Minimalist,
does not, and never will, attempt to provide a POSIX runtime
environment for POSIX application deployment on MS-Windows. If you
want POSIX application deployment on this platform, please consider
Cygwin instead.app
安装也很是容易 http://www.mingw.org/wiki/Getting_Startedide
直接去此页面下载,而后安装时选择安装c编译器,固然若是忘记勾选,直接cmd命令行this
mingw-get install gcc g++ mingw32-make
都是能够的命令行
将C:\MinGW\bin 加入环境变量而后新建sublime text 2编译规则
{
"cmd": ["gcc","${file}", "-o", "${file_path}/${file_base_name}"],
//"cmd": ["make"],
"file_regex": "^(..[^:]):([0-9]+):?([0-9]+)?:? (.)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",orm
"variants":
[
{
"name": "Run",
"cmd": ["${file_path}/${file_base_name}"]
}
]
}ci
以后重启sublime text2 就能够了开发
若是懒得配置能够下载CodeBlocks的集成开发环境,这个自带mingw,直接能够开发了,get
不过我仍是以为重量了点,sublime text2配合mingw很是轻量级