Issue
When I use ANativeWindow_setBuffersDataSpace in NDK,it prompts no error.But I build the project,the logcat shows that
"undefined reference to ANativeWindow_setBuffersDataSpace'clang++: error: linker command failed with exit code 1 " . However I can find this API in native_window.h "__INTRODUCED_IN(28);"and I set minsdk 28.
Solution
Add libnativewindow.so to linked libraries, e.g. if you use CMake:
add_library(MainActivity SHARED MainActivity.cpp)
target_link_libraries(MainActivity
android
native_app_glue
EGL
GLESv1_CM
nativewindow
)
Answered By - Mykola Khyliuk
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.