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 > Falling at the first hurdle!

Falling at the first hurdle!
Thread Tools
JH
Junior Member
Join Date: Apr 2001
Location: UK
Status: Offline
Reply With Quote
Jun 19, 2001, 01:38 PM
 
Sorry if this is very basic stuff but here's the story - I've just borrowed a book from a friend to try and teach myself C++, I've opened up Project builder and started a new C++ file. Lesson 1 - The basics of C++, I typed the following in,

/*
* hello.cpp
* Created by jeff on Tue Jun 19 2001.
* Copyright (c) 2001 __CompanyName__. All rights reserved.
*
*/

#include <Carbon/Carbon.h>
#include <iostream>
int main ()
{
cout<<"Hello World!";
return 0;
}

Then I saved it as hello.cpp and opened up the terminal to compile it using, cc hello.cpp and it comes back with the message below-
/usr/bin/ld: Undefined symbols:
___ls__7ostreamPCc
_cout

What went wrong?
Cheers

[ 06-19-2001: Message edited by: JH ]
     
Dedicated MacNNer
Join Date: Apr 2001
Location: San Francisco, USA
Status: Offline
Reply With Quote
Jun 19, 2001, 01:54 PM
 
Compile using <font face = "courier">c++ hello.cpp</font>
     
JH  (op)
Junior Member
Join Date: Apr 2001
Location: UK
Status: Offline
Reply With Quote
Jun 19, 2001, 03:49 PM
 
Success!
It's produced a file called a.out

Er...now how do I run it?
Cheers
Jeff
     
Dedicated MacNNer
Join Date: Apr 2001
Location: San Francisco, USA
Status: Offline
Reply With Quote
Jun 19, 2001, 04:00 PM
 
<font face = "courier">./a.out</font>
     
JH  (op)
Junior Member
Join Date: Apr 2001
Location: UK
Status: Offline
Reply With Quote
Jun 19, 2001, 04:09 PM
 
Honeydew-
Thanks for the prompt reply!
Jeff
     
   
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:22 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