Link errors when using AudioUnit framework in a Cocoa app
Link errors when using AudioUnit framework in a Cocoa app
- Subject: Link errors when using AudioUnit framework in a Cocoa app
- From: "Hans Kuder" <email@hidden>
- Date: Sat, 2 Jun 2007 22:01:49 -0400
Hello,
I'm trying to add audio playback and recording functionality to an app written mostly in Objective-C. (I was using MTCoreAudio, but it turns out I need more flexibility.) I'm using the default output AudioUnit for all my playback. Everything compiles correctly, but I'm getting an "Undefined symbols:" error during linking. The undefined symbols are all found in the AudioUnit framework, even though I've #included that in my source.
Some relevant snippets of my code:
*** In WorkerThread.h: ***
...
#import "AudioIOCA.h"
...
********
WorkerThread.mm has various calls to an instance of AudioIO, defined here:
*** AudioIOCA.h: ***
#include <Carbon/Carbon.h>
#include <CoreAudio/CoreAudio.h>
#include <AudioUnit/AudioUnit.h> // <----- AudioUnit included here
#include <AudioToolbox/AudioToolbox.h>
class AudioIO {
public:
OSStatus setupOutputObject(AudioStreamBasicDescription* inputDesc);
OSStatus setupCallbacks();
void setReadBuffer(float* newBuffer, UInt32 numFrames);
void startPlaying();
void stopPlaying();
OSStatus aioRenderProc(AudioBufferList *ioData,
UInt32 inNumFrames);
private:
unsigned char* readBuffer;
UInt32 lastIndex;
UInt32 bufferFrames;
UInt32 bufferBytes;
ComponentDescription outDesc;
Component outComp;
AudioUnit* outUnit;
AURenderCallbackStruct renderCallback;
AudioStreamBasicDescription* readStreamDesc;
AudioStreamBasicDescription* outStreamDesc;
AudioConverterRef converter;
};
*******
AudioIOAC.mm has various calls to AudioUnitGetProperty and SetProperty, as well as AudioOutputUnitStart and Stop.
The error I'm getting:
/usr/bin/ld: Undefined symbols:
_AudioOutputUnitStart
_AudioOutputUnitStop
_AudioUnitGetProperty
_AudioUnitGetPropertyInfo
_AudioUnitSetProperty
I suspect this has something to do with mixing Objective-C host code, a C++ class, and the C AudioUint API, but I'm not too sure what needs to be done to get everything to play nicely together. Do I need to be using extern's around some of this to get the symbols to register correctly? If so, where would I put them? Any other ideas?
Any help would be greatly appreciated. Thanks!
Hans
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden