Separate names with a comma.
Discussion in 'Mac Programming' started by stevento, Feb 25, 2008.
how do i compile C in terminal?
gcc isn't a command
Did you install XCode? If not, insert your OS X disc and install it.
if i have a file called hello.c then i enter gcc hello.c to compile it but i dont know what to enter to run the program..?
./ is linux but i dont know what it is here
If you simply compile with the command 'gcc hello.c' it will create a executable called 'a.out'. To run this enter this into terminal './a.out'
To create a more meaningful name for the exec, use this:
gcc hello.c -o hello (gcc <sourcefile.c> -o <desiredname>)
oh yeah it works