taka-no-me / android-cmake

CMake toolchain file and other scripts for the Android NDK
1.22k stars 438 forks source link

Problem with static compilation #58

Open M1cha opened 9 years ago

M1cha commented 9 years ago

this is my config: cmake -DANDROID_ABI="armeabi-v7a with NEON" -DANDROID_NATIVE_API_LEVEL=android-22

/media/Data/android/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: /media/Data/android/android-ndk-r10d/platforms/android-21/arch-arm/usr/lib/libc.a(new.o): multiple definition of 'operator delete(void*)' /media/Data/android/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: /media/Data/android/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a(del_op.o): previous definition here

If I switch to stlport_static I get this error: /tmp/ndk-user/tmp/build-stlport/ndk/sources/cxx-stl/gabi++/src/fatal_error.cc:65: error: undefined reference to 'dlopen' /tmp/ndk-user/tmp/build-stlport/ndk/sources/cxx-stl/gabi++/src/fatal_error.cc:68: error: undefined reference to 'dlsym' /tmp/ndk-user/tmp/build-stlport/ndk/sources/cxx-stl/gabi++/src/fatal_error.cc:72: error: undefined reference to 'dlclose'

what this basically means is that I can't use any stl without having some kind of weird errors.