Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

Android NDK 16b #364

Open
paulocoutinhox opened this issue May 10, 2018 · 3 comments
Open

Android NDK 16b #364

paulocoutinhox opened this issue May 10, 2018 · 3 comments

Comments

@paulocoutinhox
Copy link

Hi,

Always that i change the NDK to 16b i got:

inni-support/support-lib/jni/djinni_support.cpp
  In file included from /Users/paulo/Developer/workspaces/cpp/ubook-library-core/vendor/dependency-djinni-support/support-lib/jni/djinni_support.cpp:18:
  In file included from /Users/paulo/Developer/workspaces/cpp/ubook-library-core/vendor/dependency-djinni-support/support-lib/jni/djinni_support.hpp:21:
  In file included from /Users/paulo/Developer/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include/memory:72:
  In file included from /Users/paulo/Developer/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include/iosfwd:40:
  In file included from /Users/paulo/Developer/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/postypes.h:40:
  In file included from /Users/paulo/Developer/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include/cwchar:44:
  In file included from /Users/paulo/Developer/android-ndk-r16b/sysroot/usr/include/wchar.h:33:
  In file included from /Users/paulo/Developer/android-ndk-r16b/sysroot/usr/include/stdio.h:42:
  In file included from /Users/paulo/Developer/android-ndk-r16b/sysroot/usr/include/sys/types.h:36:
  /Users/paulo/Developer/android-ndk-r16b/sysroot/usr/include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
  #include <asm/types.h>
           ^~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.

Can you make an update to NDK 16b?

@artwyman
Copy link
Contributor

I haven't tried an NDK so new, so no direct experience. Sounds like the header includes within the NDK are messed up. I know newer NDKs have deprecated GCC, so this might be related to that.

@paulocoutinhox
Copy link
Author

@paulocoutinhox
Copy link
Author

paulocoutinhox commented May 18, 2018

I solve the problem with this code in my CMakeLists.txt:

set(USE_NDK_UNIFIED_HEADERS TRUE) # TRUE or FALSE

if (${USE_NDK_UNIFIED_HEADERS})
    if (${ANDROID_ABI} STREQUAL "x86_64")
        include_directories(${ANDROID_SYSROOT}/usr/include/x86_64-linux-android)
    elseif (${ANDROID_ABI} STREQUAL "x86")
        include_directories(${ANDROID_SYSROOT}/usr/include/i686-linux-android)
    elseif (${ANDROID_ABI} STREQUAL "arm64-v8a")
        include_directories(${ANDROID_SYSROOT}/usr/include/aarch64-linux-android)
    elseif (${ANDROID_ABI} MATCHES "^armeabi(-v7a)?$")
        include_directories(${ANDROID_SYSROOT}/usr/include/arm-linux-androideabi)
    elseif (${ANDROID_ABI} STREQUAL "mips")
        include_directories(${ANDROID_SYSROOT}/usr/include/mipsel-linux-android)
    elseif (${ANDROID_ABI} STREQUAL "mips64")
        include_directories(${ANDROID_SYSROOT}/usr/include/mips64el-linux-android)
    endif()
endif()

But i dont know if djinni need changes, because in my tests i dont need change djinni and compile all tests with NDK16b without problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants