各位大神们 小弟最近研究android NDK 在编译apv的pdfview2.so时候出现问题如下:
环境是win7 + cygwin ;相应的libfreetype.a和头文件都已经导入到jni下的对应目录里。需要的LOCAL_STATIC_LIBRARIES := mupdf fitz mupdf fitzdraw jpeg这些static lib都对应生成了。
错误提示 找不到freetype这个库,我不知道是cygwin路径问题还是什么,都放到对应的地方了 怎么还找不到呢?
//----------------------------------
SharedLibrary : libpdfview2.so
E:/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -lfreetype
//----------------------------------
这是android.mk的内容
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# $(LOCAL_PATH)/include/cairo
# -lcairo -lpixman-1 -
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mupdf/fitz $(LOCAL_PATH)/../mupdf/mupdf $(LOCAL_PATH)/include
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -lz -llog -L$(LOCAL_PATH)/lib -lfreetype
#out/apps/pdfview2/libpng.a
LOCAL_STATIC_LIBRARIES := mupdf fitz mupdf fitzdraw jpeg
LOCAL_MODULE := pdfview2
LOCAL_SRC_FILES := pdfview2.c
include $(BUILD_SHARED_LIBRARY)
//-------------------------------------------
以下是对freetype的congfigure信息。
$ ./configure --prefix="/target/dir" --host=arm-linux --disable-shared --enable-static
FreeType build system -- automatic system detection
The following settings are used:
platform unix
compiler cc
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk
If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.
Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (the latter needs python).
Generating modules list in ./objs/ftmodule.h...
* module: truetype (Windows/Mac font files with extension *.ttf or *.ttc)
* module: type1 (Postscript font files with extension *.pfa or *.pfb)
* module: cff (OpenType fonts with extension *.otf)
* module: cid (Postscript CID-keyed fonts, no known extension)
* module: pfr (PFR/TrueDoc font files with extension *.pfr)
* module: type42 (Type 42 font files with no known extension)
* module: winfnt (Windows bitmap fonts with extension *.fnt or *.fon)