如何编译以x code多文件C程序 [英] How to compile C program with multiple files in Xcode

查看:339
本文介绍了如何编译以x code多文件C程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上运行Mac OS X 10.6.3和X code 3.2.1 64位和我在想,如果有可能编译多个C程序 .C 在X code的档案。

I am on a Mac running Mac OS X 10.6.3 and Xcode 3.2.1 64-Bit and I was wondering if it was possible to compile a C program with multiple .c files in Xcode.

在此先感谢!

推荐答案

当然是的。

假设你是从头开始(不含现有的X code ++项目),做一个新项目,并选择的Mac OS应用程序 - >命令行工具 - >C项目模板

Assuming you're starting from scratch (without an existing XCode project), do a "new project" and choose the "Mac OS Application" -> "Command Line Tool" -> "C" project template.

这会给你一个模板的main.c骨架工程。编辑/替换随需的main.c,你的.c文件的剩余部分添加到源集团和建设。

That will give you a skeleton project with a template "main.c". Edit/replace "main.c" as needed, and add the rest of your .c files to the "source" group and build.

这篇关于如何编译以x code多文件C程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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