如何在Sublime Text 2中编译和运行C程序? [英] How do I compile and run a C program in Sublime Text 2?

查看:394
本文介绍了如何在Sublime Text 2中编译和运行C程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是全新的编程。我不知道如何编译&在Sublime Text 2中运行一个简单的C程序。

I am completely new to programming. I have no idea how to compile & run a simple C program in Sublime Text 2.

(在大学里,我被要求使用Turbo C ++ 3.0,但我发现IDE很古老。)

(In college I was asked to use Turbo C++ 3.0 but I found that IDE quite ancient.)

我使用Windows 8(x64)。这是我点击构建时出现的错误。

I'm using Windows 8 (x64). Here's the error I got when I clicked on build.

推荐答案

我意识到你提到你刚刚接受编程,但此网页可能仍有助于您了解发生了什么。基本上,它看起来好像你没有指定要编译的C文件的名称在build命令中正确。在该网页给出的示例中,要编译的文件由 $ file 参数指定。

I realize you mentioned that you're new to programming but this page might still help you to figure out what's going on. Basically, it looks as if you're not specifying the name of the C file to compile in the build command correctly. In the example given at that webpage, the file to be compiled is specified by the $file parameter.

编辑:再次查看输出,尝试将文件保存为* .c文件 - File->另存为调用它像 Hello.c 。在这种情况下,.c扩展名是很重要的。

Looking again at the output, try saving your file as a *.c file--File->Save As and call it something like Hello.c. The .c extension is the important thing in this case.

编辑2:你不需要两个; 在第4行结束。这不太可能是你的问题(应该编译确定),但它不需要,你不应该陷入习惯。

EDIT 2: You don't need two ; at the end of line 4. That's unlikely to be your problem (should compile ok) but it's not needed and you shouldn't get into the habit.

这篇关于如何在Sublime Text 2中编译和运行C程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆