 |
 |
c++ & "new"
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Berkeley, CA
Status:
Offline
|
|
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
|
|
Are you compiling with the "c++" command, not the "cc" command?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Berkeley, CA
Status:
Offline
|
|
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
|
|
/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 ]
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Berkeley, CA
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jul 2001
Location: Berkeley, CA
Status:
Offline
|
|
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.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |