View Single Post
Amen-Moses

 
Member Since: Apr 25, 2003
Location: The home of the free and the land that did for Braveheart.
Posts: 1,301
Amen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really nice
Mac Specs: 24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs

Amen-Moses is offline
Quote:
Originally Posted by boletje View Post
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..

#include stdio.h

main()
{
printf("Hello worl/n");
}

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".

Amen-Moses

(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.)
QUOTE Thanks