0

I have a first shared library:

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

I want to call a function in this first shared library from a second shared library:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE    := two
LOCAL_SRC_FILES := two.c
LOCAL_SHARED_LIBRARIES := one
LOCAL_LDLIBS := -llog -landroid -L/path/obj/local/armeabi/ -lone
include $(BUILD_SHARED_LIBRARY)

In the first shared library, I have:

nm -D /path/obj/local/armeabi/libone.so | grep \ T
000046cd T _Z13setInputFramePcii

I'm calling in the second shared library the same function as it's defined in the first library:

void setInputFrame(char* data, int iWidth, int iHeight);

During linkage of the second library, Eclipse says that it can't find the function. Any idea why?

For some other reasons, I need to have the first library as a shared (non static) library.

gregoiregentil
  • 1,793
  • 1
  • 26
  • 56

1 Answers1

0

I'm was mixing C++ and C. Adding extern "C" fixes the problem.

Cristik
  • 30,989
  • 25
  • 91
  • 127
gregoiregentil
  • 1,793
  • 1
  • 26
  • 56