It sounds like it is time for a sanity check. Have you compiled C programs on Unix before? If not, there are a few steps to learn.
First of all, you need a program to compile. Start your vim (or just type vi - it is included with the OS) and enter the following:<pre>
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}</pre>
For more information about how to use VI, consult any one of several hundred
VI cheat sheets. Basically, you have "command" mode and "edit" mode. Press i or a to enter "edit" mode. Press escape to return to "command mode". Type 'ZZ' in command mode to save and quit. For the above example, in command mode, type ":w hello.c". Then type 'ZZ' to quit.
Now you have a source file named "hello.c". To compile it, type:<pre>gcc hello.c</pre>
Now you have created an executable with the default file name of "a.out". To run it, type:<pre>./a.out</pre>
This tells the BASH shell to find the a.out program in the current directory and run it. You should get a nice message.
Next, give it a more meaningful name. Type:<pre>gcc -o hello hello.c</pre>Now you can type:<pre>./hello</pre>
You can create as many source files as you want and compile them all with:<pre>gcc -o myapp *.c</pre>
Once you get tired of recompiling all your files every time, you need to start using make. Here are complete
instructions. As you can see, it can be "challenging". At this point, you might want to consider using Xcode. Try to write and compile the same program in Xcode.
Have fun!
iMac Mac OS X (10.4.6)