ndk icon indicating copy to clipboard operation
ndk copied to clipboard

Conflicting locale headers in 16.0.4442984 Android NDK

Open nipunja opened this issue 6 years ago • 3 comments

Android NDK Details Pkg.Desc = Android NDK Pkg.Revision = 16.0.4442984

I am compiling my native source code using llvm headers against standalone toolchain by giving ANDROID_STL=c++_shared option. I am facing compile errors due to conflicting headers of locale under sysroot and llvm.

Conflicting Headers

  • $(NDK)/sources/cxx-stl/llvm-libc++/include\support/xlocale/__nop_locale_mgmt.h:20:24 static inline locale_t duplocale(locale_t) {

  • $(NDK)/sysroot/usr/include\locale.h:77:10 locale_t duplocale(locale_t __l) __INTRODUCED_IN(21);

Build Command E:\nugetcache\androidndk.16.1.17\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android --gcc-toolchain=E:/nugetcache/androidndk.16.1.17/toolchains/x86_64-4.9/prebuilt/windows-x86_64 --sysroot=E:/nugetcache/androidndk.16.1.17/sysroot -IE:/HVC/moderninput.voice/Android/ModernInput/src/main/cpp/../../../../../shared/core/external/boost/include -IE:/HVC/moderninput.voice/Android/ModernInput/src/main/cpp/../../../../../shared/core/external/cpprestsdk/include -IE:/HVC/moderninput.voice/Android/ModernInput/src/main/cpp/../../../../../shared/core/external/rapidjson/include -isystem E:/nugetcache/androidndk.16.1.17/sources/cxx-stl/llvm-libc++/include -isystem E:/nugetcache/androidndk.16.1.17/sources/android/support/include -isystem E:/nugetcache/androidndk.16.1.17/sources/cxx-stl/llvm-libc++abi/include -isystem E:/nugetcache/androidndk.16.1.17/sysroot/usr/include/x86_64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -O2 -DNDEBUG -fPIC -MD -MT CMakeFiles/office-voice-sdk.dir/augloop/AndroidMediaCaptureJni.cpp.o -MF CMakeFiles\office-voice-sdk.dir\augloop\AndroidMediaCaptureJni.cpp.o.d -o CMakeFiles/office-voice-sdk.dir/augloop/AndroidMediaCaptureJni.cpp.o -c E:/HVC/moderninput.voice/Android/ModernInput/src/main/cpp/augloop/AndroidMediaCaptureJni.cpp In file included from E:/HVC/moderninput.voice/Android/ModernInput/src/main/cpp/augloop/AndroidMediaCaptureJni.cpp:2: In file included from E:/HVC/moderninput.voice/Android/ModernInput/src/main/cpp/augloop/AndroidMediaCapture.h:4: In file included from E:/HVC/moderninput.voice/Android/ModernInput/src/main/cpp/augloop/../../../../../../shared/core/augloop/IMediaCapture.h:4: In file included from E:/nugetcache/androidndk.16.1.17/sources/cxx-stl/llvm-libc++/include\iostream:38: In file included from E:/nugetcache/androidndk.16.1.17/sources/cxx-stl/llvm-libc++/include\ios:216: In file included from E:/nugetcache/androidndk.16.1.17/sources/cxx-stl/llvm-libc++/include__locale:54: E:/nugetcache/androidndk.16.1.17/sources/cxx-stl/llvm-libc++/include\support/xlocale/__nop_locale_mgmt.h:20:24: error: static declaration of 'duplocale' follows non-static declaration static inline locale_t duplocale(locale_t) { ^ E:/nugetcache/androidndk.16.1.17/sysroot/usr/include\locale.h:77:10: note: previous declaration is here locale_t duplocale(locale_t __l) __INTRODUCED_IN(21);

E:\nugetcache\androidndk.16.1.17\sources\cxx-stl\llvm-libc++\include\support\xlocale__nop_locale_mgmt.h:24:20: error: static declaration of 'freelocale' follows non-static declaration

E:\nugetcache\androidndk.16.1.17\sources\cxx-stl\llvm-libc++\include\support\xlocale__nop_locale_mgmt.h:27:24: error: static declaration of 'newlocale' follows non-static declaration

E:\nugetcache\androidndk.16.1.17\sources\cxx-stl\llvm-libc++\include\support\xlocale__nop_locale_mgmt.h:31:24: error: static declaration of 'uselocale' follows non-static declaration

nipunja avatar Feb 14 '20 06:02 nipunja

Update your NDK. We don't support r16.

DanAlbert avatar Feb 14 '20 07:02 DanAlbert

Is that a known issue with NDK r16 ?

nipunja avatar Feb 17 '20 11:02 nipunja

You can search here, but that's so long ago that I don't remember.

DanAlbert avatar Feb 17 '20 19:02 DanAlbert