如何在项目外部的CodeBlocks中编译和运行C文件? [英] How to compile and run a C file in CodeBlocks which is outside a project?

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

问题描述

我已经在CodeBlocks中打开了一个项目,该项目可以成功构建并运行。现在,如果我在IDE中打开另一个C文件,则build and run命令将对现有的打开项目起作用,而不对新的C文件起作用。如果有多个项目,我们可以使用激活项目在它们之间切换。但是,如果在项目外部有一个活动项目而又有另一个C文件,该怎么办。然后如何编译和运行C文件?

I have opened a project in CodeBlocks, which builds and runs successfully. Now if I open another C file in the IDE, the build and run command will act on the existing open project and not on the new C file. If there were multiple projects, we can switch between them using " activate project" . But what if there is one active project and another C file outside the project. How to complile and run the C file then ?

推荐答案


  1. 在<$ c下左侧的$ c>项目标签,右键单击您的项目,然后单击关闭项目。对所有打开的项目执行此操作。

  1. Under the Projects tab on the left, right- click on your project and click Close project. Do this for all projects that are open.

现在,如果您的C文件已打开,只需按 F9 编译并运行您的程序。

Now, if your C file is open, just press F9 to compile and run your program.

很容易在Code中编译并运行一个C文件: :块:

It is easy to compile and run a single C file in Code::Blocks:


  1. 要创建文件,请单击 File -> 新建-> 空文件

  2. 键入代码后,用<$保存c $ c> .c 扩展名。

  3. F9 编译并运行程序。
  4. li>
  1. To create the file, click on File -> New -> Empty file
  2. After typing the code, save it with .c extension.
  3. Press F9 to compile and run the program.

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

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