i made a file.c on xcode, what next please ?

Member
Posts: 178
Joined: 2008.09
Post: #1
how can i run a file.c that i made on xcode please ?
thanks! Wacko

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #2
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...

"When you dream, there are no rules..."
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #3
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
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #4
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.

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #5
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.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #6
Thanks you.
its working now
i can see on the console hello word,

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

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Post Reply