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++ & "new"

c++ & "new"
Thread Tools
Dam
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 21, 2001, 01:11 AM
 
So I wrote this glut program a while back and it compiled fine with cc in os x (and it still does in bloodshed on windows), but recently I tried to recompile it and it fails saying:
"
/usr/bin/ld: warning prebinding disabled because of undefined symbols
/usr/bin/ld: Undefined symbols:
___throw
"

and I eventually traced it back to a 'new' statement instantiating a class.

Anyone else see this? Or know how I can undo whatever the last update to the developer tools was safely?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 22, 2001, 03:27 AM
 
Are you compiling with the "c++" command, not the "cc" command?
     
Dam  (op)
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 22, 2001, 04:10 PM
 
cc has the c++ compiler integrated - it uses a c / c++ / obj-c compiler based on the file name extension.

To be sure though, I tried it with with the straight 'c++' compiler and got the same error.

Thanks for the reply though.
     
Dedicated MacNNer
Join Date: Apr 2001
Location: San Francisco, USA
Status: Offline
Reply With Quote
Jul 22, 2001, 05:33 PM
 
/usr/bin/ld: warning prebinding disabled because of undefined symbols
/usr/bin/ld: Undefined symbols:
___throw
If 'throw' is undefined, perhaps you don't have exception handling enabled?

Try compiling with <font face = "courier">c++ -fhandle-exceptions</font>
/Developer/Documentation/DeveloperTools/Compiler/Compiler.6.html

[ 07-22-2001: Message edited by: honeydew ]
     
Dam  (op)
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 27, 2001, 01:14 AM
 
I tried that but it didn't work either. It said:
"cc1plus: warning: -fhandle-exceptions has been renamed to -fexceptions (and is now on by default)
/usr/bin/ld: Undefined symbols:
___throw
"

Has anyone else seen this error or should I just reinstall the dev tools?
     
Junior Member
Join Date: Jul 2001
Location: Canada
Status: Offline
Reply With Quote
Jul 27, 2001, 07:49 AM
 
Have you tried retyping the line? I think I got the same error, and it was because I kept the option key down while typing a space. For example, if you type cout «« "Hello World\n" and keep the option key down after typing the second «, then this won't compile.
     
Dam  (op)
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 27, 2001, 01:30 PM
 
I ended up reinstalling the dev tools and it fixed the problem. I guess some library must have gotten screwed up or something.

Thanks for all the suggestions though.
     
   
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:44 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