0

我们开发了自定义音频单元和音频单元托管应用程序。我们正在尝试从应用程序动态注册自定义音频单元。下面的代码片段用于动态注册音频单元。(此代码片段在 Apple 技术说明 Technical Note TN2247 中提及)

#include <AudioUnit/AudioComponent.h>
extern AudioComponentPlugInInterface*
                MyExampleAUFactoryFunction(const AudioComponentDescription *inDesc);

OSStatus RegisterMyExampleAudioUnit()
{
    //  fill out the version number for the AU
    UInt32 theVersion = 0x00010000;

    //  fill out the AudioComponentDescription
    AudioComponentDescription theDescription;
    theDescription.componentType = kAudioUnitType_Effect;
    theDescription.componentSubType = 'EXAU';
    theDescription.componentManufacturer = 'MYCO';
    theDescription.componentFlagsMask = 0;

    //  Use the flag to indicate that this AudioComponent is Sandbox Safe
    theDescription.componentFlags = kAudioComponentFlag_SandboxSafe;

    //  call AudioComponentRegister()
    return AudioComponentRegister(&theDescription, CFSTR("My Company: MyExampleAU"),
                            theVersion, MyExampleAUFactoryFunction);

在编译音频单元托管应用程序时,我们遇到了链接器错误。

架构 i386 的未定义符号:
“_MyExampleAUFactoryFunction”,引用自:

谁能帮我解决这个问题。

4

1 回答 1

0

我也遇到了这个问题,我的项目只有 C 和 Objective-C 代码。它有助于创建单个 cpp 类并将其也添加到项目中。我不知道链接器内部的更深层原因是什么。

于 2015-08-31T10:24:46.257 回答