title: Compiling for Android using Make on OSX
body: <p>Fair warning I am somewhat new to GCC development.</p>
  <p>I am currently trying to do a personal port of Box2D to android (tech arm). I create a standalone toolchain, export the following....</p>
  <blockquote>
  <p>export PATH=/tmp/my-android-toolchain/bin:$PATH</p>
  <p>export CC=arm-linux-androideabi-gcc</p>
  <p>export CXX=arm-linux-androideabi-g++</p>
  </blockquote>
  <p>Then I run Make, everything &quot;seems&quot; to be running fine, however, at the end I see...</p>
  <blockquote>
  <p>/private/tmp/my-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: bin/Debug/<strong>libBox2D.a: no archive symbol table (run ranlib)</strong>
  /private/tmp/my-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: obj/Debug/HelloWorld/Helloworld.o: in function main:../../HelloWorld/Helloworld.cpp:38: error: undefined reference to 'b2World::b2World(b2Vec2 const&amp;)'
  /private/tmp/my-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: obj/Debug/HelloWorld/Helloworld.o: in function main:../../HelloWorld/Helloworld.cpp:47: error: undefined reference to 'b2World::CreateBody(b2BodyDef const*)'
  /private/tmp/my-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: obj/Debug/HelloWorld/Helloworld.o: in function main:../../HelloWorld/Helloworld.cpp:53: error: undefined reference to 'b2PolygonShape::SetAsBox(float, float)'</p>
  </blockquote>
  <p>If I open up a new terminal (essentially killing the exports) and delete the bin and obj folder everything compiles fine. A quick Google search suggests this could be related to it using the llvm compiler instead of GCC (although with my CC I think this less likely). There are the following instructions for llvm in the standalone toolchain doc...</p>
  <blockquote>
  <p>If you wish, add --llvm-version=3.1 to also copy clang/llvm 3.1.</p>
  </blockquote>
  <p>Should I add llvm? Is this an issue with bionic being different?</p>
  <p>Thanks!</p>