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 > C++

C++
Thread Tools
Senior User
Join Date: Mar 2003
Status: Offline
Reply With Quote
Feb 15, 2004, 10:15 AM
 
just starting to learn this was wondering how/where do i code and compile the c++ on a mac?

thanks for any help

MacbookPro dual 2Ghz 1GB Ram 128 Graphics
     
Mac Elite
Join Date: Dec 1999
Location: Plainview, NY
Status: Offline
Reply With Quote
Feb 15, 2004, 12:51 PM
 
Originally posted by billybob128:
just starting to learn this was wondering how/where do i code and compile the c++ on a mac?

thanks for any help
XCode. /Developer/Applications
     
Senior User
Join Date: Mar 2003
Status: Offline
Reply With Quote
Feb 15, 2004, 03:15 PM
 
ok thanks but that looks well hard to use any tutorials on the internet or anywhere?

MacbookPro dual 2Ghz 1GB Ram 128 Graphics
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Feb 15, 2004, 03:24 PM
 
XCode is very simple to use. There's some online help, as well as on Apple's web site.

Or you could just do it the same way it's done on other unix systems. Ie, type up the code in a text editor, and use GCC to compile and build it.

I prefer XCode :-)
     
Fresh-Faced Recruit
Join Date: Dec 2003
Status: Offline
Reply With Quote
Feb 15, 2004, 10:38 PM
 
If you're coming from a command-line development environment, rather than Visual C++ or something, try the Terminal app (in /Applications/Utilities) to get a command line, and use GCC, which I believe comes pre-installed.
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Feb 16, 2004, 08:44 AM
 
Originally posted by billybob128:
just starting to learn this was wondering how/where do i code and compile the c++ on a mac?
You don't elaborate on your programming experience, but C++ is not a good choice for a beginning programmer. Not at all. C++ is really a good choice for someone who knows C and an object-oriented (OO) programming language like Java or Python, and wants a high-performance language that maintains the OO paradigm. C++ doesn't enforce good OO constructs, so it's important to understand OO before you learn C++.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
Feb 16, 2004, 10:50 AM
 
Open the Terminal app, write your main.cpp file, then compile it with
g++ main.cpp

For example,

----------snip---------------
#include <iostream>
using std::cout;
using std::endl;

int main()
{
cout << "hello world!" << endl;
return 0;
}
---------snip---------------

after compiling with 'g++ main.cpp', run it by typing

./a.out
     
Senior User
Join Date: Mar 2003
Status: Offline
Reply With Quote
Feb 16, 2004, 10:55 AM
 
no background at all but im learning the c language from www.vtc.com quite easy but their player pragramm is crap really slow andit keep crashing with the bug report. oh well i can do hello world and age variables in xcode so ill stick with that.

thanks for all your input

MacbookPro dual 2Ghz 1GB Ram 128 Graphics
     
   
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 12:59 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