Linker Error on import C Library

Mac OSX specific forum
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Linker Error on import C Library

Post 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)
macOS Catalina 10.15.7
Wolfram
Enthusiast
Enthusiast
Posts: 567
Joined: Thu May 30, 2013 4:39 pm

Re: Linker Error on import C Library

Post 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)
macOS Catalina 10.15.7
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Linker Error on import C Library

Post 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
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply