Page 1 of 1

Linker Error on import C Library

Posted: Mon Aug 19, 2019 1:29 am
by Wolfram
Why do I get an Linker error on importing the "AudioUnitGetPropertyInfo()" function?

Code: Select all

ImportC "-framework AudioToolbox"
  AUParameterListenerNotify(inSendingListener.i, *inSendingObject, *inParameter) 
  AudioUnitGetPropertyInfo(Audio_Unit.i, inID.l, scope.l, inElement.l, *size, *state)
EndImport

Audio_Unit.i
inID.l
scope.l
inElement.l
size.l
state.i
 AudioUnitGetPropertyInfo(Audio_Unit.i, inID.l, scope.l, inElement.l, @size, @state)

Re: Linker Error on import C Library

Posted: Tue Aug 20, 2019 12:10 pm
by Wolfram
I got it, I used the wrong frame work.

Code: Select all

ImportC "-framework AudioUnit"
  AudioUnitGetPropertyInfo(Audio_Unit.i, inID.l, scope.l, inElement.l, *size, *state)
EndImport

ImportC "-framework AudioToolbox"
  AUParameterListenerNotify(inSendingListener.i, *inSendingObject, *inParameter) 
EndImport

Audio_Unit.i
inID.l
scope.l
inElement.l
size.l
state.i

AudioUnitGetPropertyInfo(Audio_Unit, inID, scope, inElement, @size, @state)

Re: Linker Error on import C Library

Posted: Tue Aug 20, 2019 1:07 pm
by wilbert
Wolfram wrote:I got it, I used the wrong frame work.
Good that you found the solution.

This also seems to work.

Code: Select all

ImportC "-framework AudioUnit -framework AudioToolbox"
  AudioUnitGetPropertyInfo(Audio_Unit.i, inID.l, scope.l, inElement.l, *size, *state)
  AUParameterListenerNotify(inSendingListener.i, *inSendingObject, *inParameter) 
EndImport