0

When I use ndk, I can not find symbols in shared_libraries.

Android.mk :

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test
LOCAL_SRC_FILES := test.cpp
include $(BUILD_SHARED_LIBRARY)

test.cpp:

void fun() {}

after ndk-build, nm /libs/armeabi/libtest.so, the result is no symbols, why ?

Mehran
  • 1,409
  • 2
  • 17
  • 27
humble00
  • 11
  • 1

1 Answers1

0

@auselen is right about NDK_DEBUG=1, but also bear in mind that you have to use the right nm: if you use the default nm from your computer, which is most probably an x86 computer, it won't be able to read the symbols of a library compiled for an ARM architecture (most android phones).

The right nm to use for your output lib located in libs/armeabi/ is: ${you_ndk_folder}/toolchains/arm-linux-androideabi-*/prebuilt/darwin-x86_64/bin

(The darwin-x86_64 is if you're developping on Mac, it's different if you're on Windows or Linux, but you get the idea..)

mbrenon
  • 4,851
  • 23
  • 25