如何在Sublime Text 2,Windows 8中构建和运行c程序?

前端之家收集整理的这篇文章主要介绍了如何在Sublime Text 2,Windows 8中构建和运行c程序?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
作为一个新手程序员,我已经用mingw安装了Codeblocks(不知道这是什么意思),选择了默认编译器,并且可以构建和运行正常.

我安装了Sublime Text 2,复制粘贴你好世界程序:

  1. // my first program in C++
  2.  
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main ()
  8. {
  9. cout << "Hello World!";
  10. return 0;
  11. }

然后我建立,得到错误信息:

  1. [Error 2] The system cannot find the file specified
  2. [cmd: [u'bash',u'-c',u"g++ '' -o '/' && '/'"]]
  3. [dir: C:\Windows\system32]
  4. [path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\]
  5. [Finished]

为了使用Sublime Text 2运行一个简单的程序,我需要做些什么?

解决方法

解决了. Sublime Text 2需要g,bash等才能编译.这些包需要安装在您的计算机上,按照本页上的说明:

http://www.claremontmckenna.edu/pages/faculty/alee/g++/g++.html

重要信息:在构建和运行之前,请确保将文件保存在驱动器上.

猜你在找的HTML相关文章