我正在尝试调整本教程, Android Studio中的Android NDK Endless-Tunnel。
https://github.com/googlesamples/android-ndk/tree/master/endless-tunnel/app/src/main/cpp
在我需要使用之前效果很好 'glBindVertexArray'/'glGenVertexArrays',然后从GLESv2切换到GLESv3。
Build command failed.
Error while executing process /root/Android/Sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /pathx/app/.externalNativeBuild/cmake/debug/x86 --target game}
[1/1] Linking CXX shared library /pathx/app/build/intermediates/cmake/debug/obj/x86/libgame.so
FAILED: : && /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=i686-none-linux-android16 --gcc-toolchain=/root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 -fPIC --sysroot /root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -std=gnu++11 -Wall -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -u ANativeActivity_onCreate -shared -Wl,-soname,libgame.so -o /pathx/app/build/intermediates/cmake/debug/obj/x86/libgame.so CMakeFiles/game.dir/android_main.cpp.o CMakeFiles/game.dir/anim.cpp.o CMakeFiles/game.dir/ascii_to_geom.cpp.o CMakeFiles/game.dir/dialog_scene.cpp.o CMakeFiles/game.dir/indexbuf.cpp.o CMakeFiles/game.dir/input_util.cpp.o CMakeFiles/game.dir/jni_util.cpp.o CMakeFiles/game.dir/native_engine.cpp.o CMakeFiles/game.dir/obstacle.cpp.o CMakeFiles/game.dir/obstacle_generator.cpp.o CMakeFiles/game.dir/our_shader.cpp.o CMakeFiles/game.dir/play_scene.cpp.o CMakeFiles/game.dir/scene.cpp.o CMakeFiles/game.dir/scene_manager.cpp.o CMakeFiles/game.dir/sfxman.cpp.o CMakeFiles/game.dir/shader.cpp.o CMakeFiles/game.dir/shape_renderer.cpp.o CMakeFiles/game.dir/tex_quad.cpp.o CMakeFiles/game.dir/text_renderer.cpp.o CMakeFiles/game.dir/texture.cpp.o CMakeFiles/game.dir/ui_scene.cpp.o CMakeFiles/game.dir/util.cpp.o CMakeFiles/game.dir/vertexbuf.cpp.o CMakeFiles/game.dir/welcome_scene.cpp.o -landroid libnative_app_glue.a -latomic -lEGL -lGLESv3 glm/libglm.a -llog -lOpenSLES -latomic -lm && :
/root/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lGLESv3
/pathx/app/src/main/cpp/android_main.cpp:147: error: undefined reference to 'glUseProgram'
/pathx/app/src/main/cpp/android_main.cpp:148: error: undefined reference to 'glUniformMatrix4fv'
/pathx/app/src/main/cpp/android_main.cpp:149: error: undefined reference to 'glUniformMatrix4fv'
/pathx/app/src/main/cpp/android_main.cpp:154: error: undefined reference to 'glClearColor'
/pathx/app/src/main/cpp/android_main.cpp:155: error: undefined reference to 'glClear'
/pathx/app/src/main/cpp/android_main.cpp:157: error: undefined reference to 'glBindVertexArray'