Android studio 或者 xcode 使用第三方库时可能出现这个问题,
could not read symbols: File in wrong format
这是由于自己编译的 .a 静态库 或 .so 动态库 与目标平台不一致导致(ARM)
解决方案是,把源代码复制到自己的项目中,让Android Studio 或 Xcode 来编译(当然前提条件它是开源的)
http://bbs.csdn.net/topics/330005765
例如 android studio 编译 lua (CMakeList)
# Specifies a path to native header files.
include_directories(src/main/lua-5.3.3/)
add_library( lua-lib
STATIC
src/main/lua-5.3.3/lapi.c
src/main/lua-5.3.3/lcorolib.c
src/main/lua-5.3.3/ldump.c
src/main/lua-5.3.3/llex.c
src/main/lua-5.3.3/lopcodes.c
src/main/lua-5.3.3/lstrlib.c
src/main/lua-5.3.3/lauxlib.c
src/main/lua-5.3.3/lctype.c
src/main/lua-5.3.3/lfunc.c
src/main/lua-5.3.3/lmathlib.c
src/main/lua-5.3.3/loslib.c
src/main/lua-5.3.3/ltable.c
src/main/lua-5.3.3/lundump.c
src/main/lua-5.3.3/lbaselib.c
src/main/lua-5.3.3/ldblib.c
src/main/lua-5.3.3/lgc.c
src/main/lua-5.3.3/lmem.c
src/main/lua-5.3.3/lparser.c
src/main/lua-5.3.3/ltablib.c
src/main/lua-5.3.3/lutf8lib.c
src/main/lua-5.3.3/lbitlib.c
src/main/lua-5.3.3/ldebug.c
src/main/lua-5.3.3/linit.c
src/main/lua-5.3.3/loadlib.c
src/main/lua-5.3.3/lstate.c
src/main/lua-5.3.3/ltm.c
src/main/lua-5.3.3/lvm.c
src/main/lua-5.3.3/lcode.c
src/main/lua-5.3.3/ldo.c
src/main/lua-5.3.3/liolib.c
src/main/lua-5.3.3/lobject.c
src/main/lua-5.3.3/lstring.c
src/main/lua-5.3.3/lzio.c )
以上