Error during linking when trying to use FMOD in Cocoa app

BobimusPrime
Unregistered
 
Post: #1
I am trying to use FMOD for the audio in my game and I am getting multiple definitions of symbol errors when linking during the build process in ProjectBuilder.

There are seven multiple definition errors and they are listed here:

ld: multiple definitions of symbol std::exception::what() const
ld: multiple definitions of symbol std::bad_exception::~bad_exception [in-charge deleting]()
ld: multiple definitions of symbol std::exception::~exception [in-charge deleting]()
ld: multiple definitions of symbol std::unexpected()
ld: multiple definitions of symbol std::set_unexpected(void (*)())
ld: multiple definitions of symbol std::terminate()
ld: multiple definitions of symbol std::set_terminate(void (*)())

One of the two definitions of these symbols seems to come from libstdc++.a as shown here:

ld: multiple definitions of symbol std::exception::what() const
/Users/bobbo/Desktop/DigiKid/libfmod.a(NewMore.cp.o) private external definition of std::exception::what() const in section (__TEXT,__coalesced_text)
/usr/lib/gcc/darwin/3.1/libstdc++.a(eh_exception.o) private external definition of std::exception::what() const in section (__TEXT,__text)

I never manually included libstdc++.a in my project so I'm guessing it comes from one of the frameworks I'm using.

The frameworks I'm using are OpenGL, ApplicationServices, AudioUnit, Cocoa, Carbon, Foundation, and AppKit though I will probably remove AudioUnit if I get FMOD working okay.

So anyway, if anyone knows how to make these errors go away please let me know. libstdc++.a sounds kind of important so I'm guessing doing anything to that would not be a good idea.

Thanks ahead of time.

Robert
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #2
I am using FMOD in my Cocoa project and I don't think I had to change anything... so it must be conflicting with one of your other frameworks?
Quote this message in a reply
BobimusPrime
Unregistered
 
Post: #3
I forgot to mention that most of the source files I'm using are .cpp's. That's probably a big reason why libstdc++.a is being used.
Quote this message in a reply
BobimusPrime
Unregistered
 
Post: #4
Is there some way of removing symbols from a library?
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #5
I don't think so. I think that would require you rebuilding the library from modified source.
Quote this message in a reply
Member
Posts: 320
Joined: 2003.06
Post: #6
just to let you know, I added a few C++ classes to a cocoa app today that had fMod already going, and I got those same 7 errors. To be honest I'm finding fMod isn't as great as they say anyway... pausing of mods doesn't seem to work, sounds don't play on some systems, and some midi files don't seem to play. It does, however have a lot of juicy features.

It would seem its still rather buggy on the mac platform

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Quote this message in a reply
Apprentice
Posts: 7
Joined: 2007.02
Post: #7
Quote:Originally posted by BobimusPrime
Is there some way of removing symbols from a library?


You can break the library into its object files, using ar -x then make a new library, excluding the object files you don't want.
I did this to get rid of some stuff from libfmod.a (dynamic_cast was one) and was surprised to find that it worked! This was for a carbon app though (WMD), not cocoa.
Quote this message in a reply
BobimusPrime
Unregistered
 
Post: #8
Well, it appears as though this problem only occurs with FMOD 3.70. I found a copy of 3.60 and am having no more issues with the multiple symbols error.

Thanks for the input

Robert
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  FMOD and Cocoa Holmes 8 4,509 Jul 23, 2003 08:43 PM
Last Post: Holmes
  What's the difference between FMOD and mikmod? ThrottleMonkey 5 3,717 Apr 30, 2003 04:08 PM
Last Post: Mars_999
  FMOD - MAC Version Himiona 5 3,675 Apr 25, 2003 08:04 PM
Last Post: Mars_999