Ambiguous Linker Error

Member
Posts: 23
Joined: 2006.12
Post: #1
(Although for me there isn't any other kind of linker error.)

I'm pretty sure this will end up being something with a rather easy fix, but for the time being, it's driving me crazy. I'm trying to integrate the ODE physics library into a very simple game engine I have running on C++/SDL/OGL.

However, once I got rid of all the usual syntax errors and got it to the point where it should actually work, I goto run the program and I get Unknown Symbol errors. (Well, I get those in Release mode, in debug mode the progam just crashes.)

I know this has something to do with the way I'm linking the ODE library, but I'm not sure how. It finds <ode/ode.h> just fine, and I've got my additional header search directories along with framework directories set.

My only guess as to what is causing the issue comes from what I found in the readme last night. It said that ODE can only be linked to from C. So I then try and protect my #include <ode/ode.h> with extern "C" {}. Well that does me no good because then I get a ton of C Linkage from template errors. Cry

So lost am I. Any help would be greatly appreciated.

P.S. (Because I didn't think this message was quite long enough.)
Should I just avoid ODE all together? I seem to have noticed that the ODE community isn't quite as active as the Newton one. And that updates to the library don't happen as often. Are there any particular advantages to Newton or even Bullet?
Quote this message in a reply
Member
Posts: 45
Joined: 2006.11
Post: #2
Try disabling zero-link from your xcode project settings. It might fail to link properly, but might also give you a more helpful error message, like which symbols are missing. Feel free to post the build log after you do this if it fails.

My guess is that there is an undefined symbol, which zero-link is happily ignoring until you try to run your app.

-JeroMiya

Edit: I have gotten ODE to build and link properly with a C++ application before. You shouldn't have to put the extern "C" in yourself. It's a bit tricky getting the library itself to link properly for OSX, so that may have been what went wrong. You may have used the wrong makefile or makedef. It's been so long I forgot exactly what needs to be done.

ODE has some good qualities, but I've never had much luck with its simulation stability. My walls and vehicles always seem to explode at random times. It's not up to par with Havok 2's stability/accuracy (ie, Half Life 2) but that's a commercial product.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  'Unidentified error' error in Xcode scgames 2 3,773 Jun 10, 2006 01:38 AM
Last Post: scgames
  Linker Errors With DrawStuff Library Nick 5 3,544 Mar 13, 2006 08:32 PM
Last Post: OneSadCookie
  Linker Errors And Finding Solutions Nick 8 3,898 Jan 29, 2006 06:36 PM
Last Post: Nick
  XCode 2.0 linker woes ( Tiger ) TomorrowPlusX 2 3,544 May 2, 2005 07:20 AM
Last Post: TomorrowPlusX
  Xcode Linker Errors maaaaark 9 5,676 Mar 17, 2005 02:44 PM
Last Post: OneSadCookie