Broken library, OpenAL... how do I fix?

Discussion in 'iOS Programming' started by jshmrsn, Sep 21, 2008.

  1. jshmrsn macrumors member

    Joined:
    Jul 26, 2008
    #1
    For some reason, no matter what I do, any application using OpenAl will not build in xCode.

    It goes through the entire build process fine, but fails at the linking stage. It fails to find any al___ symbol.

    These problems occur even in the provided OpenALExample and the iPhone's OpenAL example as well.


    Example:

    Code:
      "_alcCaptureStart", referenced from:
          _alcCaptureStartProc in Scene.o
      "_alDopplerFactor", referenced from:
          -[Scene setDopplerFactor:] in Scene.o
      "_alcGetString", referenced from:
          -[Controller awakeFromNib] in Controller.o
          -[Controller awakeFromNib] in Controller.o
      "_alDistanceModel", referenced from:
          -[Scene setDistanceModel:] in Scene.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    
    I have another Mac that I've been trying to copy over any OpenAl-related files from, but hasn't had any affect yet.

    I'm running 10.5.4

    Thanks so much for any help!
    -Josh Rosen
     
  2. kpua macrumors 6502

    Joined:
    Jul 25, 2006
    #2
    Add the framework to your project. You're including the files so it compiles, but you have to specify which frameworks to link against. It's in /System/Library/Frameworks/.
     
  3. jshmrsn thread starter macrumors member

    Joined:
    Jul 26, 2008
    #3
    I have; the unmodified OpenALExample includes the framework as normal.

    Thanks,
    Josh Rosen
     
  4. jshmrsn thread starter macrumors member

    Joined:
    Jul 26, 2008
    #4
    [I removed this post because it's no longer true, still having the same problem]
     
  5. kpua macrumors 6502

    Joined:
    Jul 25, 2006
    #5
    Odd... And you've verified that it's under the "Link with Libraries" phase in your project's target?
     
  6. jshmrsn thread starter macrumors member

    Joined:
    Jul 26, 2008
    #6
    Actually I was able to get the standard OpenAlExample to compile, however I still can't get the iPhone's CrashLanding example to compile.

    Also, yes in both cases the .framesworks were listed under the linking build phase.

    I guess I'll open this topic in the iPhone programming section now.

    http://forums.macrumors.com/showthread.php?p=6280337#post6280337

    - Josh Rosen
     
  7. jshmrsn thread starter macrumors member

    Joined:
    Jul 26, 2008
    #7
    Broken library, OpenAL... how do I fix?

    I'm trying to use OpenAL with my iPhone app. I've been having some very frustrating problems with the linking phase of any build using OpenAl. At first this included the both the OpenALExample for Mac and the CrashLanding examples for iPhone.

    But I've been able to get the Mac version working, but still not CrashLanding (which is why I'm moving to the iPhone section).

    When I try to build an unmodified version of CrashLanding the compiler fails to link any al____ symbols.

    Example:

    Code:
      "_alDeleteSources", referenced from:
          SoundEngineEffect::~SoundEngineEffect()in SoundEngine.o
      "_alGenSources", referenced from:
          SoundEngineEffect::SoundEngineEffect(char const*, char const*, char const*, unsigned char)in SoundEngine.o
      "_alGenBuffers", referenced from:
          SoundEngineEffect::LoadFileData(char const*, void*&, unsigned long&, unsigned int&)in SoundEngine.o
      "_alSource3f", referenced from:
    
    etc...
    Code:
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    

    I'm assuming there are some files that are corrupt or missing on my system, but I can't figure out what they are. I've tried replacing all the OpenAL.frameworks with files copied from my other Mac (which can build CrashLanding)

    Any ideas would be greatly appreciated!

    Thanks,
    Josh Rosen
     
  8. axlsd macrumors newbie

    Joined:
    Oct 8, 2008
    #8
    Hi,
    I had the same trouble.. that becouse I installed the OpenAL API downloaded from creativelabs.com. When I tried to compile the crashlanding sources I got linker error that said the version of my openal framework is for another architecture..(x86 I think.. iphone simulator needs arm libraries).

    I don't know why, but xcode tried to link openal framework in /library/frameworks/ while the correct version is in the iphone sdk framework directory..

    I resolved just renaming (or removing) openal framework from /library/frameworks/ directory.. (you need to do it by root user or with sudo)
    Just try.. it worked for me.

    I hope this can help,
    Bye, Alex
     
  9. Ozirus macrumors newbie

    Joined:
    Nov 6, 2008
    #9
    Thanks :D

    After having struggled for a long time to fix this problem, the solution proposed by axlsd worked for me. I opened the Terminal.app and typed:

    Code:
    sudo mv /Library/Frameworks/OpenAL.framework /Library/Frameworks/OpenAL.framework.bak
    Hope this helps someone out there :)
     
  10. Godzil macrumors newbie

    Joined:
    Nov 7, 2008
    #10
    Hi, I will start by thanks for this fix, it solve my own problem, and I have a silly question, did you have, all of you that has got this problem, a 10.4 updated to 10.5 OS X ?

    It may answer why we have an OpenAL framework in /Library/Framework, where it should be (and there is one) in /System/Library/Framework
     
  11. Ozirus macrumors newbie

    Joined:
    Nov 6, 2008
    #11
    Yes, indeed. I am using a 10.4 upgraded to 10.5... Good catch Godzil :D

    However, I am still trying to figure out why /Library/Frameworks is searched before the SDK frameworks.

    Does anyone know where this behaviour is specified?

    I know it is possible to define $LIBRARY_SEARCH_PATHS and $FRAMEWORK_SEARCH_PATHS but it seems there is no default value (see http://developer.apple.com/DOCUMENT...Build_Setting_Reference/build_setting_ref.htm).
     
  12. Godzil macrumors newbie

    Joined:
    Nov 7, 2008
    #12
    It seems logic for me to search in this order :


    ~/Library/Framework
    /Library/Framework
    /System/Library/Framework

    Why ?

    Simply because, you may want to add a new version of a framework, but you may at least have no right to modify /Library/Framework, so the system if it search by default in /System will never get, and same thing about /Library/Framework. You should never, even if you can, modify things in /System/Library, the only one who need and have right to do modifications here is Apple.
    For me, every application that make modification here, is not correctly coded, it should use /Library instead and never mess with /System/Library
     
  13. Ozirus macrumors newbie

    Joined:
    Nov 6, 2008
    #13
    Hi Godzil,

    I totally agree with you on this point and this is exactly what is puzzling me...

    How can I tell XCode to use the platform specific frameworks instead of the ones located in /Library/Frameworks (which should have lower priority in the search paths)?

    In other words, why does

    Code:
    /Library/Frameworks/OpenAL.framework
    come before

    Code:
    /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/System/Library/Frameworks/OpenAL.framework
    ? :confused:
     

Share This Page