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 > Can I learn C++ on OSX??

Can I learn C++ on OSX??
Thread Tools
dice
Forum Regular
Join Date: Jul 2002
Location: Ireland
Status: Offline
Reply With Quote
Oct 8, 2002, 03:09 PM
 
right I have a few questions about C++ on the Mac...

I start learning C++ in college soon but on PCs , is it possible to practise on my mac at home? I notice there is a C++ "tool" in project builder can this be used or would I have to use the terminal or what. Can I make stand-alone applications that I can double click on?

Also is it possible for C++ apps on OSX to have a GUI or just the console?

sorry for the silly questions but I want to know


thanks for your time.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 8, 2002, 03:27 PM
 
Yes, you can compile C++ on the Mac. You can use the "C++ Tool" template in Project Builder if you'd like. This will create a program that you'll have to run either through Project Builder's console or the Terminal.

If you don't want to use Project Builder, you can just write your code in a normal text file and compile it in the Terminal with gcc.

You can make normal GUI applications in C++, but AFAIK you'd have to go through Carbon, and that is much more of a headache than a beginner would want to go through.
( Last edited by Chuckit; Oct 8, 2002 at 04:38 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
smeger
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Oct 8, 2002, 05:50 PM
 
You can edit & compile things in the terminal using, for example, 'vi main.cpp' and 'g++ main.cpp'

You can also use the C++ tool in Project Builder to create the same type of console program as you would from Terminal.

Or you can combine C++ code with calls to either/both the Carbon/Cocoa APIs to make GUI applications. It's very very easy to slap a rudimentary user interface onto a C++ program using Cocoa and Interface Builder - if you read through Apple's Currency Converter tutorial and you already know how to write C++, you're pretty much done.
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
Gul Banana
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Oct 8, 2002, 10:22 PM
 
OS X is certainly a viable platform for learning C++, given that I'm doing just that at the moment.
[vash:~] banana% killall killall
Terminated
     
Detrius
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status: Offline
Reply With Quote
Oct 8, 2002, 11:04 PM
 
Also, it would be important to point out that C++ alone does NO GUI work at all. With C++, you can do command line programs. You would have to learn some separate API to do GUI programming. Thus, if you are learning C++ in a class, you will be just fine on OS X.
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
HoOn
Junior Member
Join Date: Sep 2002
Location: New Jersey
Status: Offline
Reply With Quote
Oct 8, 2002, 11:08 PM
 
Okay, I just bought my iBook this past weekend and when I try to compile something for C++ it says that "gcc: command not found". Do I need to install the GCC compiler? Can someone tell me where I should download or get the necessary packages. Thanks!
     
dice  (op)
Forum Regular
Join Date: Jul 2002
Location: Ireland
Status: Offline
Reply With Quote
Oct 9, 2002, 03:45 AM
 
cool thanks for the replies , you cleared up a lot of quiries.
     
hayesk
Guest
Status:
Reply With Quote
Oct 9, 2002, 09:15 AM
 
Originally posted by HoOn:
Okay, I just bought my iBook this past weekend and when I try to compile something for C++ it says that "gcc: command not found". Do I need to install the GCC compiler? Can someone tell me where I should download or get the necessary packages. Thanks!
You have to install the Developer tools. I believe they are on one of the install CDs, in a folder somewhere. If not, you can download them from Apple. Be sure to have a fast Internet connection if you go that route.
     
Detrius
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status: Offline
Reply With Quote
Oct 9, 2002, 10:12 AM
 
Originally posted by hayesk:


You have to install the Developer tools. I believe they are on one of the install CDs, in a folder somewhere. If not, you can download them from Apple. Be sure to have a fast Internet connection if you go that route.
I've heard that with new computers, the installer is in /Applications/Installers
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
   
 
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
Top
Privacy Policy
All times are GMT -4. The time now is 08:48 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,