paulrouget / servofocus

Experimenting with a Xamarin.Forms + Servo
5 stars 2 forks source link

Android build (on Mac) fails with compiler error #45

Open corliss opened 6 years ago

corliss commented 6 years ago

I tried running rust/android/build.sh --verbose on macOS. It seems to compile the dependencies just fine. But in (what I think is) the last step of compiling servobridge, the build stops with this error:

note: /Users/corliss/Library/Developer/Xamarin/android-ndk/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: 
cannot find -lc++
          collect2: error: ld returned 1 exit status
          toolchain: /Users/corliss/Library/Developer/Xamarin/android-ndk/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin
          libs dir: /Users/corliss/Library/Developer/Xamarin/android-ndk/android-ndk-r11c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a
          sysroot: /Users/corliss/Library/Developer/Xamarin/android-ndk/android-ndk-r11c/platforms/android-18/arch-arm
          targetdir: /Users/corliss/Library/Developer/Xamarin/android-ndk/android-ndk-r11c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a

It looks like the compiler cannot locate the standard C++ library, lc++. Any idea what could be causing this?

paulrouget commented 6 years ago

Make sure to use NDK version 12 or 12b. Other than that, I'm not sure. Is the library libc++.so in the ndk?