1

i was using android ndk 13b with visual studio 2017 and i got an update for android ndk 15c which added one error. I am also using new Clang 5.0 (before it was 3.8). This is the error :

/usr/local/google/buildbot/src/android/ndk-r15-release/ndk/sources/android/support/src/stdio/vfprintf.c(242): error : undefined reference to '__signbit'

This is my verbose full response :

1>Android clang version 5.0.300080 (based on LLVM 5.0.300080) 1>Target: i686-none-linux-android 1>Thread model: posix 1>InstalledDir: C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\llvm\prebuilt\windows-x86_64\bin 1>Found candidate GCC installation: C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\x86-4.9\prebuilt\windows-x86_64/lib/gcc/i686-linux-android\4.9.x 1>Selected GCC installation: C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\x86-4.9\prebuilt\windows-x86_64/lib/gcc/i686-linux-android/4.9.x 1>Candidate multilib: .;@m32 1>Selected multilib: .;@m32 1> "C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\x86-4.9\prebuilt\windows-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin\ld" "--sysroot=C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\platforms\android-23\arch-x86" --eh-frame-hdr -m elf_i386 -shared -o "x86\Release\libPredictEngineMultiLang.so" "C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\platforms\android-23\arch-x86/usr/lib\crtbegin_so.o" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\5.0.300080\lib\linux\i386" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\x86-4.9\prebuilt\windows-x86_64/lib/gcc/i686-linux-android/4.9.x" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\x86-4.9\prebuilt\windows-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/lib" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\platforms\android-23\arch-x86/usr/lib" "-rpath-link=C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\platforms\android-23\arch-x86\usr\lib" "-rpath-link=C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\platforms\android-23\arch-x86\usr\lib" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\platforms\android-23\arch-x86\usr\lib" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\x86-4.9\prebuilt\windows-x86_64\lib\gcc\i686-linux-android\4.9.x" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\sources\cxx-stl\llvm-libc++\libs\x86" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\x86-4.9\prebuilt\windows-x86_64\lib\gcc\i686-linux-android\4.9.x" "-LC:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\sources\cxx-stl\llvm-libc++\libs\x86" --no-undefined -z relro -z now -z noexecstack "x86\Release\CharsetConverter.o" "x86\Release\CppSQLite3.o" "x86\Release\PhonemConverterEN.o" "x86\Release\PhonemConverterFR.o" "x86\Release\PhoneticEngineEN.o" "x86\Release\PhoneticEngineFR.o" "x86\Release\PredictDb.o" "x86\Release\PredictEngineEN.o" "x86\Release\PredictEngineFR.o" "x86\Release\SearchEngineEN.o" "x86\Release\SearchEngineFR.o" "x86\Release\sqlite3.o" "x86\Release\DictionaryEN.o" "x86\Release\DictionaryFR.o" "x86\Release\PhonemEN.o" "x86\Release\PhonemFR.o" "x86\Release\PredictEN.o" "x86\Release\PredictFR.o" "C:\Users\hhenry-garon\Downloads\OpenSSL-for-Android-Prebuilt-master\OpenSSL-for-Android-Prebuilt-master\openssl-1.0.2\x86\lib\libcrypto.a" -landroid_support -lc++_static -lc++abi -landroid_support -lc++_static -lc++abi -llog -landroid -lgcc -ldl -lc -lgcc -ldl "C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r15c\platforms\android-23\arch-x86/usr/lib\crtend_so.o" 1>/usr/local/google/buildbot/src/android/ndk-r15-release/ndk/sources/android/support/src/stdio/vfprintf.c(242): error : undefined reference to '__signbit' 1>clang.exe : error : linker command failed with exit code 1 (use -v to see invocation)

I am compiling in x86 a android library .so with Clang 5.0 on visual studio 2017. I only read that maybe i can add a no-stdio configuration but i have no idea where to do that in visual studio 2017.

Thanks

2 Answers 2

1

For anyone else running into this - I resolved this by adding "m" to the "Library Dependencies" in the linker flags in vs. It seems like libc++ has a dependency on the c math library. Functions like printf, sprintf etc are using __signbit.

Sign up to request clarification or add additional context in comments.

1 Comment

fixed it for both ARM and x86. For ARM64/x64 it is not required.
0

There is issues with Android NDK 15c on Visual studio 2017. I was using LLVM static and i changed for GNU static, everything works now.

Thanks to microsoft (not)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.