android - Android 未定义对 ANativeWindow_setBuffersTransform API 的引用
问题描述
我在尝试使用 ANativeWindow_setBuffersTransform API 时收到以下链接错误。编译的 SDK 版本为 28
undefined reference to `ANativeWindow_setBuffersTransform'
在我的 CMAKE 文件中,我将目标库与 android 库链接
target_link_libraries( # Specifies the target library.
native-lib
android
GLESv2
EGL
realsense2
libpcl_recognition
libpcl_tracking
libpcl_registration
libpcl_stereo
libpcl_segmentation
libpcl_ml
libpcl_keypoints
libpcl_features
libpcl_2d
libpcl_surface
libpcl_io_ply
libpcl_io
libpcl_filters
libpcl_sample_consensus
libpcl_search
libpcl_octree
libpcl_kdtree
libpcl_common
libboost_date_time
libboost_filesystem
libboost_iostreams
libboost_program_options
libboost_regex
libboost_signals
libboost_system
# Links the target library to the log library
# included in the NDK.
${log-lib})
在我的源代码文件中,我包含了标题
#include <android/native_window.h>
我还可以使用其他 NativeWindow 功能,例如
ANativeWindow_lock
ANativeWindow_setBuffersGeometry
ANativeWindow_unlockAndPost
编译器抱怨的只是 ANativeWindow_setBuffersTransform 。
有人有什么主意吗 ?是否有人能够成功调用此功能并可以分享一些信息?提前致谢。
解决方案
ANativeWindow_setBuffersTransform 存在于 nativewindow.so 中,在 CMAKE 中只需将 nativewindow 添加到链接库列表中,它应该编译和链接
推荐阅读
- mysql - 如何在 PhP 中使用用户密码解密数据库数据?
- spring - 在 Spring Project 中存储用户上传的文件的安全有效的方法是什么?
- javascript - 使用回调动态加载多个远程脚本?
- sql - 计算表中的数据序列
- javascript - 一个输入 Html5 中有两个 RegExp 模式
- azure-application-insights - 使用依赖注入在派生的 ActionFilterAttribute 中获取 RequestTelemetry(或 ITelemetry)
- drupal-8 - 在 Drupal 8 中设置默认地址字段的值
- amazon-redshift - 在 Amazon Redshift 中将值数组拆分为行
- java - 当我点击返回按钮 5 次时如何显示插页式广告
- c# - SSRS 表单身份验证 - 如何将 Cookie 凭据传递到报表服务器