Member Since: Apr 25, 2003
Location: The home of the free and the land that did for Braveheart.
Mac Specs: 24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs
03-05-2007, 02:29 PM
Originally Posted by boletje
so i downloaded apple developer tools (Xcode 2) and installed it. I made doubly sure i had GCC 3.3 and 4.0 installed aswell as X11 but, i assume the main installer installs these rather then me having to go through every package manually.
I wrote a simple "Hello" program using the text editor "VI" in terminal. But..im a little unsure how to execute. normlly i did "a.out test" and it would compile and run..but it appears differently in OS X.
Anything im doing wrong? my code is below..but i know its rght lol..
a.out is the default name for the executable created by cc after it is compiled and linked.
If your source file is called test.c then try cc test.c
And it probably should be #include "stdio.h"
Oh and you left the d off of "world".
(edited to add: Mind you, you really want to use XCode, if you have fully installed it the main XCode executable is in /Developer/Applications.
Google for XCode tutorials as well.)