google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.97k stars 1.22k forks source link

Sample build fail with NDK r20 #804

Closed psklf closed 3 years ago

psklf commented 5 years ago

SPECIFIC ISSUE ENCOUNTERED

When build hello_ar_c sample project, build fail.

  1 error generated.
  FAILED: Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++  --target=i686-none-linux-android24 --gcc-toolchain=Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot  -Dhello_ar_native_EXPORTS -I../../../../src/main/cpp -IAndroid/Sdk/ndk-bundle/sources/third_party/vulkan/src/libs/glm -isystem/Project/SampleCode/arcore-android-sdk/samples/hello_ar_c/../../libraries/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security  -std=c++11 -Wall -O0 -fno-limit-debug-info  -fPIC -MD -MT CMakeFiles/hello_ar_native.dir/src/main/cpp/jni_interface.cc.o -MF CMakeFiles/hello_ar_native.dir/src/main/cpp/jni_interface.cc.o.d -o CMakeFiles/hello_ar_native.dir/src/main/cpp/jni_interface.cc.o -cSampleCode/arcore-android-sdk/samples/hello_ar_c/app/src/main/cpp/jni_interface.cc
  In file included fromSampleCode/arcore-android-sdk/samples/hello_ar_c/app/src/main/cpp/jni_interface.cc:21:
  In file included from ../../../../src/main/cpp/hello_ar_application.h:30:
  In file included from ../../../../src/main/cpp/background_renderer.h:26:
  In file included from ../../../../src/main/cpp/util.h:31:
  ../../../../src/main/cpp/glm.h:20:10: fatal error: 'glm.hpp' file not found
  #include "glm.hpp"
           ^~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.

VERSIONS USED

STEPS TO REPRODUCE THE ISSUE

  1. Build the hello_ar_c project

WORKAROUNDS (IF ANY)

Use the NDK of version 19c

ADDITIONAL COMMENTS

Can't find the GLM in NDK directory (version 20)

fredsa commented 5 years ago

Thanks for reporting this issue. This issue is caused by the fact that NDK r20 stopped bundling glm as part of the Vulkan distribution.

Options if this issue is blocking you:

  1. Workaround this issue by using NDK version 19c (as suggested above)
  2. Wait for the fix for the inclusion of the glm library in an upcoming release of the ARCore SDK for Android
  3. Patch the current release manually (requires some work):