Straight C?

stylewise

Registered
Hi Guys,

A quick question, in a thread recently posted some one asked about free compilation tools for beginners. While Admiral AK gave him an answer, I would like to see if some one else can shed a little light on somthing specific for me.

I'm a college student taking my first structured programming class using C and I want to use my G3 Power book to work on some of the programs. We will be doing straight C, no chaser, nothing special. I just need a simple compiler. I have the dev tools installed and have found the C++ compiler to be easy to use. In terminal just type C++ and the source file, viola. However, the same thing does not seem to exist for straight C files. I don't need a full IDE although it would be nice, just looking for a compiler.

I tried to use project builder with out much success -- i don't need any carbon/ coca stuff. Nothing I'm doing is that advanced. Is their a simple gnu c compiler, or am I missing some terminal command like C++ for C? Or can I use the project builder? If so how? Any help would be great. I would love to do my work sitting outside, with my PB running 10.1 :)

Thanks in advance for any help .

Stylewise
 
You can compile plain-vanilla C programs with cc:
Code:
% [b]cc helloworld.c[/b]
Good luck.

-Rob
 
You can use Project Builder too. I haven't seen the 10.1 Dev Tools, but they probably haven't changed this one. Down at the bottom of the dialog you get when you create a new file is a template called Standard Tool. Choose this one - it's for creating CLI stuff and as far as I can tell is set up to use plain 'ole C. Works well! I used it to make a small daemon for myself. The daemon leaks memory like a seive (my fault of course, haven't optimized it at all ;)), but it compiled fine and runs fine, does what I want it to.
 
Also, because C++ is a subset language of C, everything that you write in C compatible in C++. All C++ does is add to the C language by adding libraries of predefined objects/functions. It really does not matter.

If you are not running OSX, but still OS9 on your computer, there is another compiler from Apple that you can download that works in Classic.

I use Project Builder for my projects, and many of the class assignments I hammer out on my Mac in PB before I email them to myself and finish things up in the lab. The reason why I have to do that is the teacher requires the source code (no problem) and the DOS EXE file.

I find PB so much easier to use as a coding utility than most other commercial compilers including Microsoft Visual C++.
 
Thanks Guys! I really appreciate the help. cc works great, as does the project builder. Thanks for the detailed replies.

stylewise
 
I, at school, use a solaris server to do my C programming (and java too)....
so since both OS X and Solaris are unic environments I just write the code in EMACS (at the terminal type emacs to get the editor started) and then compile it with what is provided in the dev tools ;)

cc is what OS X uses (gcc is what I use in solaris)


Admiral
 
He he ;)
well he can use a text editor and then use cc filename.c ;)
Everyone was a newbie at somepoint... I was too...the best way to learn is hands on... besides I do not know all EMACS commands either :p I only know enough to get along with it...

All I need is page up, page down, find, save and exit lol
 
I am a GUI freak lol :p
I use teh GUI version when running solaris 8 on my schools computer labs :p ... some people from my class have no adventurus spirit..they go onto a sunblade with solaris 8 only to check their mail in pine ( from eh terminal) and write in emacs (from the terminal again) lol :p
 
Back
Top