Pete
Pete

Reputation: 635

Error while building the Android source

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

Answers (6)

mikeho
mikeho

Reputation: 7000

The best way to get around this error is do the following:

  1. Install gcc-4.2 and g++-4.2: brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
  2. Set the CC and CXX environment variables: export CC=/usr/local/bin/gcc-4.2 && export CXX=/usr/local/bin/g++-4.2
  3. Then build: make

If you need to install homebrew for #1, go to: Homebrew homepage

Upvotes: 3

Dekra
Dekra

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

karl tsou
karl tsou

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

hanxi
hanxi

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

artem
artem

Reputation: 16777

The only correct solution is to install XCode 3.*

Upvotes: 1

Pete
Pete

Reputation: 635

i found the answer finally :)

run make with following options

make CC=gcc CXX=g++ -j4

Everything will go smooth

Upvotes: 1

Related Questions