Page 1 of 1

How to run .c files?

Posted: February 14th, 2014, 11:35 am
by twinb7
I've seen a lot of programs recently and got them downloaded, but I don't know how to run them. I saved them as .c files because apparently that's what they're supposed to be, but how do I run them?

I'm talking about gfind, actually: https://www.ics.uci.edu/~eppstein/ca/gfind.c
and I'm using a Mac.

Re: How to run .c files?

Posted: February 23rd, 2014, 12:35 am
by Ntsimp
These are programs written in the C language. You convert them into a runnable program by running a "C compiler". I don't know Mac OS, but Google should help you install a free compiler such as gcc.

Re: How to run .c files?

Posted: February 23rd, 2014, 6:12 am
by Andrew
To compile gfind.c on a Mac, start up Terminal.app, cd to the location of that .c file, then run this command:

cc -o gfind -m32 gfind.c

Leave out the "-m32" if you want a 64-bit version. Type "./gfind c" to see help on all the options.

Re: How to run .c files?

Posted: February 24th, 2014, 11:23 am
by EricG
If you need further help, have a look at:
viewtopic.php?f=9&t=826
and
viewtopic.php?f=9&t=828

Re: How to run .c files?

Posted: February 25th, 2014, 2:50 pm
by twinb7
Thank you both!