Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jshmrsn

macrumors member
Original poster
Jul 26, 2008
43
0
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
 

kpua

macrumors 6502
Jul 25, 2006
294
0
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/.
 

jshmrsn

macrumors member
Original poster
Jul 26, 2008
43
0
I have; the unmodified OpenALExample includes the framework as normal.

Thanks,
Josh Rosen
 

jshmrsn

macrumors member
Original poster
Jul 26, 2008
43
0
[I removed this post because it's no longer true, still having the same problem]
 

kpua

macrumors 6502
Jul 25, 2006
294
0
Odd... And you've verified that it's under the "Link with Libraries" phase in your project's target?
 

jshmrsn

macrumors member
Original poster
Jul 26, 2008
43
0
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
 

axlsd

macrumors newbie
Oct 8, 2008
1
0
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
 

Ozirus

macrumors newbie
Nov 6, 2008
3
0
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 :)
 

Godzil

macrumors newbie
Nov 7, 2008
2
0
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 :)

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
 

Godzil

macrumors newbie
Nov 7, 2008
2
0
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
 

Ozirus

macrumors newbie
Nov 6, 2008
3
0
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:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.