开发者

Is there an easier way to type and compile C on Mac OS X?

开发者 https://www.devze.com 2022-12-18 15:40 出处:网络
I\'ve just started learning C on Mac OS X. I have downloaded Xcode too. So far, I have been typing my apps into TextEdit, and then using the Terminal to loca开发者_Go百科te my apps and compile them u

I've just started learning C on Mac OS X. I have downloaded Xcode too.

So far, I have been typing my apps into TextEdit, and then using the Terminal to loca开发者_Go百科te my apps and compile them using gcc hello.c etc.

Is there an easier way (using Xcode perhaps?) to type my code into some form of IDE, and then automate the compiling with a 'compile and run' button or similiar? It seems a bit primitive and tedious using TextEdit and then switching to the Terminal to compile. However, I do not have much experience with lower level languages like C, so I'm unsure if it is even possible.

Thanks


Yes that is what XCode is for.

Look at the tutorial on the open screen of XCode (version 3.2.1 for OSX 10.6) This is for objective C but the tools are the same.

Or if the objective C is confusing choose a new project from XCode. File->New Project) choose command line tool as the project type and then choose type as C from the pop up menu


Xcode will definitely be easier, although for a "hello world"-type project like yours, its advantages may not be obvious. Install it, fire it up, and leave TextEdit behind ...

OTOH, you could edit your source code in vi or emacs (in Terminal), which would avoid having to flip between Terminal and TextEdit. BTW, this is the way development used to be done ...


Use XCode, you already have it. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消