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 > Developer Center > UNIX programing question (newbie help)

UNIX programing question (newbie help)
Thread Tools
Moderator
Join Date: Sep 2000
Location: Irvine, CA
Status: Offline
Reply With Quote
Mar 10, 2001, 02:04 AM
 
I know a fair amount of C and C++. Can I compile a program via the Terminal without using ProjectBuilder?
{{{ mindwaves }}}
     
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Mar 10, 2001, 04:47 AM
 
Yes, although I don't know why you'd want to. You can type your code in pretty much any ASCII text editor. If you want to do it all fram the terminal use emacs. Then to compile, simply go to the directory that you have your code and type cc mycodename. You should make sure that your files end in .h or.cpp or .m or whatever is appropriate or else it might not compile correctly. For C++, use the command c++ from the command line instead of cc. You can also do stuff with make files and the like but I don't know how those work.
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 10, 2001, 10:14 AM
 
You can. ProjectBuilder itself is simply an interface on top of cc and gdb.

You can use the cc command to compile C, and c++ to compile C++. If you are working on a large project from the command-line, it would be best to use a Makefile, which is explained at the immortal site:
http://www.cs.cf.ac.uk/Dave/C/CE.html
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
   
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 09:52 PM.
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