Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: error: cannot open crtbegin_dynamic.o: No such file or directory

Tags:

android-ndk

I used the following...

~/Development/Android/android-ndk-r8c/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/Users/me/toolchain

Then I create the following code file...

int main () {   return 0; } 

I tried ...

<toolchain>/arm-linux-androideabi-gcc test.c 

I also tried

 <toolchain>/arm-linux-androideabi-gcc --sysroot=<toolchain>/sysroot test.c  

Both come back...

 toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory 
like image 345
Jackie Avatar asked May 28 '13 15:05

Jackie


1 Answers

To make it simpler, just set the sysroot:

<toolchain>/arm-linux-androideabi-g++ ~/test.c -o ~/test --sysroot=/home/user/android-ndk/platforms/android-9/arch-arm/ 
like image 119
BlueSilver Avatar answered Oct 10 '22 17:10

BlueSilver