undefined reference to `__android_log_print'

前端 未结 15 2081
不知归路
不知归路 2020-12-02 09:26

What is wrong with my make file?

Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE    := foo
LOCAL_SRC_FILES := foo.c
LOCAL         


        
15条回答
  •  心在旅途
    2020-12-02 09:56

    TO build with Android.bp, follow the below solution:

    In this -android_log_print is defined in NDK, so for this, there is already a library is available. Use "liblog" library using shared_libs tag, take reference of the below code:

    target: {
            android: {
                cppflags: [
                    "-g",
                    "-DUSE_LIBLOG",
                ],
                shared_libs: ["liblog"], // can use other dependency if required.
            },
            darwin: {
                enabled: false,
            },
        },  
    

提交回复
热议问题