Search code examples
iphoneobjective-ciosxcodeopenears

How to exclude undefined symbols from RapidEars framework linking?


I added a framework to my Xcode 4.4 project by drag-and-drop of the framework onto the project in the Project Navigator.

I am getting linker errors for undefined symbols on Xcode.

Undefined symbols for architecture armv7: "_returner", referenced from: _should_be_returned in RapidEarsDemo(multisphinx_re.o) "_input_sample_rate", referenced from: -[PocketsphinxController(RapidEars) startRealtimeListeningWithLanguageModelAtPath:andDictionaryAtPath:] in RapidEarsDemo(PocketsphinxController+RapidEars.o) -[ContinuousModel(RapidEars) realtimeListeningLoopWithLanguageModelAtPath:andDictionaryAtPath:] in RapidEarsDemo(ContinuousModel+RapidEars.o) -[RECommandArray commandArrayForlanguageModel:andDictionaryPath:isJSGF:] in RapidEarsDemo(RECommandArray.o) ld: symbol(s) not found for architecture armv7

I ran "nm" on the RapidEarsDemo framework file, and I only see _input_sample_rate for i386. How do I specify not to include this symbol for armv7?

"nm" doens't show _returner at all.

In Build Phases -> "Link Binaries with Project", I made sure that my new framework is listed there. I already did a clean and rebuild.

Any suggestions? Your help would be greatly appreciated!


Solution

  • The reason was that I included two frameworks. Framework A referred to framework B. I was using version 1.1 of A, but version 1.2 of B. Thus A expected symbols to exist in B, which did not exist in that version.

    Running "nm" to list the symbols was enlightening.