Is -ObjC linker flag required for RapidEars?

Home Forums OpenEars plugins Is -ObjC linker flag required for RapidEars?

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)

  • Author
    Posts
  • #1025581
    rikk
    Participant

    I have a working OpenEars 2.0.3 app. I want to add RapidEars and have followed instructions, EXCEPT for the -ObjC linker flag. It compiles and links fine.

    When I run, I get:

    2015-05-04 … Bleeper[…] -[OEPocketsphinxController startRealtimeListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:]: unrecognized selector sent to instance 0x1740b2660

    2015-05-04 … Bleeper[…] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[OEPocketsphinxController startRealtimeListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:]: unrecognized selector sent to instance 0x1740b2660’

    If I add -ObjC, it runs fine.

    So, can someone explain to me why this matters? I suspect that this means that something else is wrong in my build settings.

    Thanks,
    Rikk

    #1025582
    rikk
    Participant

    Answering my own question (I think):

    I have probed a bit more inside of the OEPocketsphinxController+RapidEars.h and saw that RapidEars is using Objective-C `category’ feature to extend the class. This was a great opportunity for me to learn about the ‘category’ feature of Objective-C.

    https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html

    As I researched more, I found this on Stack Overflow:
    http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library

    And doc from Apple:
    https://developer.apple.com/library/mac/qa/qa1490/_index.html

    ANSWER: Yes, the -ObjC linker flag is indeed required when using any plugins for OpenEars. :-D

    #1025583
    Halle Winkler
    Politepix

    Hi rikk,

    It says in the documentation and tutorial that it is necessary to add -ObjC.

    #1031744
    gregorym
    Participant

    How do I add the -ObjC flag to xcode? Is it just “-ObjC” In the “Other Linker Flags” or is it something more specific?

    #1031745
    Halle Winkler
    Politepix

    Hello,

    That’s correct, in the app target build settings.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Is -ObjC linker flag required for RapidEars?’ is closed to new replies.