Skip to content Skip to sidebar Skip to footer

Error In Linking C++ Static Library With Android Ndk(error: File Format Not Recognized)

I am trying to include static cpp library in android. This library is already compiled(on mac os) and i have its include files. Here is my Android.mk file LOCAL_PATH := $(call m

Solution 1:

From the comments and so on it sounds like you trying to use a non arm version of the library. You should build the library with the ndk. The documentation has even documentation on how to do that.

For example building sigc++ could be like (from a project of mine, where sigc++ resides in the sigc++ subdirectory)

# SIGC++ Library built as static library
LOCAL_MODULE := sigc
LOCAL_PATH = $(CURRENT_DIR)
LOCAL_CPP_EXTENSION := .cc

LOCAL_SRC_FILES :=    sigc++/signal.cc       sigc++/signal_base.cc  sigc++/trackable.cc 
LOCAL_SRC_FILES +=    sigc++/functors/slot_base.cc  sigc++/adaptors/lambda/lambda.cc 
LOCAL_SRC_FILES += sigc++/connection.cc sigc++/functors/slot.cc

LOCAL_C_INCLUDES := sigc++

include$(BUILD_STATIC_LIBRARY)

But you should really read how the compiling linking works. I am afraid building for android with ndk is more low level than using Xcode or Msvc.

Post a Comment for "Error In Linking C++ Static Library With Android Ndk(error: File Format Not Recognized)"