[Openal] MacOSX & iPhone OpenAL linking issue
E. Wing
ewmailing at gmail.com
Wed Apr 30 14:16:16 PDT 2008
On 4/29/08, stevew at rtassoc.com <stevew at rtassoc.com> wrote:
> I'm a long time windows and linux developer. I've used OpenAL for multiple
> projects and am looking to port some code to an iPhone application using the
> latest beta SDK. I've never developed for the MacOS and this is a first
> time using XCode for any professional project.
> That said, I've been looking online in an attempt to try to get OpenAL to
> link correctly in my programs. I see that MacOSX comes with OpenAL, so have
> been quite encouraged by that fact. I am including -framework OpenAL in the
> linker flags and have gotten the compile to work by adding the OpenAL
> framework to the development environment. However, I'm stuck when it tried
> to link (even the OpenAL Example project) at the same spot:
>
> it wont find the following functions:
> _alGenBuffers
> _alGenSources
> _alSourcef
> _alSourcei
> _alcCreateContext
> _alcOpenDevice
> _alcDestroyContext
> _alcCaptureSamples
> _alcGetCurrentContext
> _alGetFloat
> _alcGetPr! ocAddress
> _alSourceStop
> _alcMakeContextCurrent
> _alListenerfv
> _alGetSourcef
> _alGetSourcei
> _alSourcePlay
> _alclsExtensionPresent
> _alGetError
> _alGetString
> _alSourcefv
> _alListenerf
> _alcCloseDevice
> _alcGetEnumValue
> _alDeleteBuffers
> _alDeleteSources
> _alcCaptureOpenDevice
> _alcCaptureStart
> _alDopplerFactor
> _alcGetString
> _alDistanceModel
>
> The above is what I get when I try to link the OpenALExample found under
> /Developer/Examples/CoreAudio/Services/OpenALExample
>
> I have the same problems when trying to link my audio engine library for the
> iPhone, so my suspicion is that when I figure out what I'm doing wrong, I
> might be able to get that working too.
> Anyway, if anyone can spot what I'm doing wrong, I'd greatly appreciate a
> quick bit of help! :)
>
> Thanks!
> Steve Winston
>
iPhone SDK is under NDA. Read the agreement.
For general Mac/Xcode, instead of explicitly adding '-framework' to
the build flags, in the left-side Groups & Files panel, right-click on
one of the folders in the topmost section (if you see a Group called
'Frameworks' or a sub-group called 'Linked Frameworks', that is ideal
place). Select from the contextual menu Add->Existing Frameworks.
Then pick from /System/Library/Frameworks the OpenAL.framework to add
it to your project.
This approach generally works well with Apple's cross-compile
mechanism which supports prior versions of OS X, and Universal
Binaries.
-Eric
More information about the Openal
mailing list