Objective C: Inline function - symbol not found

前端 未结 2 1869
猫巷女王i
猫巷女王i 2021-01-04 10:16

I have a library which uses an inline C function, and is compiling just fine. When another library references that library, it still compiles fine. But if an actual app refe

2条回答
  •  一整个雨季
    2021-01-04 10:28

    just add FOUNDATION_EXPORT to function on the header (.h). Remember import Foundation/Foundation.h (OS X) or UIKit/UIKit.h (ios).

    Example:

    //.h
    #import 
    
    FOUNDATION_EXPORT inline NSString * myInlineFunction(void);
    

提交回复
热议问题