iDevGames Forums
i made a file.c on xcode, what next please ? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: i made a file.c on xcode, what next please ? (/thread-2419.html)



i made a file.c on xcode, what next please ? - imaumac - Sep 5, 2008 06:10 PM

how can i run a file.c that i made on xcode please ?
thanks! Wacko


i made a file.c on xcode, what next please ? - Taxxodium - Sep 5, 2008 07:55 PM

Hit the Build & Go button. This will only work if you created a project.

If you just created the file alone, you'd better use the Terminal. If file.c is on your Desktop try the following command:

cpp ~/Desktop/file.c file

Or something like that...


i made a file.c on xcode, what next please ? - akb825 - Sep 5, 2008 08:36 PM

cpp is the C pre-processor. If you want to compile and run from the terminal:
Code:
cd /path/to/file.c
gcc file.c -o file
./file



i made a file.c on xcode, what next please ? - imaumac - Sep 6, 2008 08:23 AM

So sorry for my Dummies questions.
realy so sorry.

i never use the terminal before, but i download some tutorials to use it.
now, i have the file on desktop, called: hello.c

on my open mac terminal, plese, what i have to write to make it work?

thanks for your help.


i made a file.c on xcode, what next please ? - Najdorf - Sep 6, 2008 08:35 AM

Hi, I assume you want to run hello world:

open xcode,
got to "file" menu, chose "new project", between the "command line utility" category chose "standard tool"

Check out the main.c file, it probably is similar to your hello.c

To run press the build and go button, it should write hello world on the console (if you dont see the console look for it in the Run menu)

from there you can start playing with the main.c file and try out more examples you find on the internet.


i made a file.c on xcode, what next please ? - imaumac - Sep 6, 2008 09:47 AM

Thanks you.
its working now
i can see on the console hello word,

now i understand.
Thanks for your valuable help to me. LOL