Reputation: 635
I am getting following error while building the android source on Mac OS X 10.7.3 (Lion):
host SharedLib: libSR_Recognizer (out/host/darwin-x86/obj/lib/libSR_Recognizer.dylib)
Undefined symbols for architecture i386:
"_pushAudioIntoRecognizer", referenced from:
_SR_RecognizerAdvanceImpl in RecognizerImpl.o
_detectBeginningOfSpeech in RecognizerImpl.o
"_generatePatternFromFrame", referenced from:
_SR_RecognizerAdvanceImpl in RecognizerImpl.o
"_canPushAudioIntoRecognizer", referenced from:
_SR_RecognizerAdvanceImpl in RecognizerImpl.o
_detectBeginningOfSpeech in RecognizerImpl.o
"_generatePatternFromFrameEOI", referenced from:
_SR_RecognizerAdvanceImpl in RecognizerImpl.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [out/host/darwin-x86/obj/lib/libSR_Recognizer.dylib] Error 1
Any clues?
Upvotes: 3
Views: 2703
Reputation: 7000
The best way to get around this error is do the following:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
CC
and CXX
environment variables: export CC=/usr/local/bin/gcc-4.2 && export CXX=/usr/local/bin/g++-4.2
make
If you need to install homebrew for #1, go to: Homebrew homepage
Upvotes: 3
Reputation: 572
Unfortunately this is a known issue in AOSP (Visit http://source.android.com/source/known-issues.html). Install brew package.
You should create your custom build using
lunch full-eng
instead of
lunch full-userdebug
I do not find problem on Android-4.1.2_r1
Upvotes: 0
Reputation: 1
Here is the fixed from Android master stram - external/srec/portable/include/PortExport.h
#if defined(__APPLE_CC__)
#if __APPLE_CC__ >= 5621
#undef PINLINE
#define PINLINE
#endif
#endif
Upvotes: 0
Reputation: 31
i fixed in this way, my compiler looks happy with this.
vi ./external/srec/srec/Recognizer/src/RecognizerImpl.c
replace all PINLINE
with /*** PINLINE ***/
- actually remove all of them
Upvotes: 3
Reputation: 635
i found the answer finally :)
run make with following options
make CC=gcc CXX=g++ -j4
Everything will go smooth
Upvotes: 1