Newbie question about OSX

J

Jason

i have a .c file which when i open with textedit seems to be the source code,

is there any way i can run this using terminal?

sorry for the stupid question, but i an new to unix and mac os x!

thanks,

Jason
 
J

Jack Klein

i have a .c file which when i open with textedit seems to be the source code,

is there any way i can run this using terminal?

sorry for the stupid question, but i an new to unix and mac os x!

thanks,

Jason

C is a compiled language. If you have C language source code, it
needs to be processed by one or more tools to turn it into an
executable program, generally at least a C compiler, which translates
the source code into machine instructions for your computer's CPU, and
a linker which takes those machine instructions and adds what support
they need from the C library and turns the result into a file in the
proper format for your operating system.

There are both commercial and free C tool sets for your
computer/operating system combination. There might actually be one
installed as standard, or on your OS CDs that you can install. If
not, there are ones you can buy and others you can download for free.

Your best bet for more detailed information would be Apple's web site
and support newsgroups for the Mac in general or Mac OS X in
particular.
 
S

SM Ryan

(e-mail address removed) (Jason) wrote:
# i have a .c file which when i open with textedit seems to be the source code,
#
# is there any way i can run this using terminal?
#
# sorry for the stupid question, but i an new to unix and mac os x!

You to install the Developer Tools. That CD is included with Panther;
for earlier systems you can buy a CD or download the CD contents. With
that you have cc and make commands just like any other unix. You also
have emacs and vi if you prefer that to TextEdit.

You can also use developer GUIs, Project Builder or XCode, that are also
installed.

For a single source file program, you can do
cc -o executable source.c
./executable
in the Terminal.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,146
Messages
2,570,831
Members
47,374
Latest member
anuragag27

Latest Threads

Top