eliranno
eliranno

Reputation: 123

Android undefined reference to ANativeWindow_setBuffersTransform API

I'm receiving the following linking error when trying to use ANativeWindow_setBuffersTransform API. complied SDK version is 28

undefined reference to `ANativeWindow_setBuffersTransform'

In my CMAKE file I link my target library with android library

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})

In my source code file I include the header

#include <android/native_window.h>

I'm also able to use other NativeWindow functions such as

ANativeWindow_lock
ANativeWindow_setBuffersGeometry
ANativeWindow_unlockAndPost

it's only ANativeWindow_setBuffersTransform that the compiler complains about.

does anyone have any idea ? was anyone able to successfully call this function and can share some info ? thanks in advance.

Upvotes: 0

Views: 670

Answers (1)

eliranno
eliranno

Reputation: 123

ANativeWindow_setBuffersTransform exists in nativewindow.so in CMAKE just need to add nativewindow to linked libraries list and it should compile and link

Upvotes: 3

Related Questions