1

我尝试在 cocos2d-x 的项目中使用 freetype lib。我构建了 freetype 并添加到项目中(比如这里http://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Android_NDK#FreeType)。在 xcode 中,它构建时没有错误。现在我试图在android上使用它。我在freetype dir中制作了文件:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := freetype
LOCAL_SRC_FILES := lib/libfreetype.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/include/freetype2

include $(PREBUILT_STATIC_LIBRARY)

并添加到主makefile

LOCAL_STATIC_LIBRARIES := freetype curl_static_prebuilt
...
$(call import-module,freetype)

链接期间出现错误:libfreetype.a:文件格式无法识别;视为链接描述文件

预建:libfreetype.a <= /Users/user/Development/Slots/Slots_Android/lib/freetype/lib/ SharedLibrary:libgame.so /Users/user/Development/android_ndk_r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/ darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld:./obj /local/armeabi/libfreetype.a:文件格式无法识别;视为链接器脚本 /Users/user/Development/android_ndk_r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/ ../../../../arm-linux-androideabi/bin/ld:./obj/local/armeabi/libfreetype.a:1:语法错误collect2:ld返回1退出状态

如何解决?

4

0 回答 0