Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > compiling help please

compiling help please
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2001
Status: Offline
Reply With Quote
Apr 24, 2003, 10:01 AM
 
Hi all,

I'm a newbie when it comes to programming and I'm trying to write up a project for Uni. However, I can't compile it (or more correctly, I'm not sure how to do it properly... I tried gcc -o -Wall -ansi -pedantic <filename> <filename.c> but command not known.)

I am using the terminal and vi is my code editing program.

Also, I downloaded vim - but I can't seem to open it from within the terminal - I have to launch it from the Finder. Is this correct?

Any help sincerely appreciated - but please bear in mind this is all new to me - so, as Homer would say, "Dumb it down for me"

Thanks.
     
Professional Poster
Join Date: Jun 2000
Status: Offline
Reply With Quote
Apr 24, 2003, 10:06 AM
 
You do have the developer tools installed, right? If so, here's how I do it and it works for me:

Code:
cc -o programname filename.c
     
Mac+  (op)
Fresh-Faced Recruit
Join Date: Oct 2001
Status: Offline
Reply With Quote
Apr 24, 2003, 09:05 PM
 
Originally posted by bradoesch:
You do have the developer tools installed, right? If so, here's how I do it and it works for me:

Code:
cc -o programname filename.c
Thanks - I tried that in the terminal window and it said cc: Command not found.

How do I check about Debeloper Tools? I tried to launch Project BuilerWO, but it just makes the big box asif it is launching - yet nothing actually happens. It is version 3.0.

I'm just trying to write a c programme using vi (so I don't know if I need the Apple developer tools). What else do I need to do?

Thanks again.
     
Forum Regular
Join Date: Jan 2002
Location: Manitoba
Status: Offline
Reply With Quote
Apr 24, 2003, 10:19 PM
 
try adding a g in front of the cc in that command as for developer tools if they are installed on your computer you should have a /Developer directory in your root/main directory tree.
     
Mac+  (op)
Fresh-Faced Recruit
Join Date: Oct 2001
Status: Offline
Reply With Quote
Apr 25, 2003, 02:08 AM
 
Originally posted by Sarah31:
try adding a g in front of the cc in that command as for developer tools if they are installed on your computer you should have a /Developer directory in your root/main directory tree.
Thanks - I did that but...

gcc: Command not found.

What gives?
     
Forum Regular
Join Date: Jun 2001
Location: On the move again...
Status: Offline
Reply With Quote
Apr 25, 2003, 09:30 AM
 
Originally posted by Mac+:
Thanks - I did that but...

gcc: Command not found.

What gives?
First make sure you do have it. gcc should be in /usr/bin (actually, it will be a symlink to gcc2 or gcc3, depending on how current your system is). cc should also be there as a link to gcc2 or gcc3.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:46 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2