未定义引用NDK的问题

时间:2013-04-07 22:25:10

标签: android eclipse android-ndk sdl sdl-ttf

好的我知道这已经提出来了。然而我的似乎没有得到解决。 在我们开始之前,请告知以下内容:

  • OS:Win7(x86)
  • IDE:Eclipse Juno(4.2)
  • NDK:r8e
  • Android API:17(Jelly Bean 4.2)

我想让SDL_ttf完全编译。我只是试图构建这个项目并继续处理事情,并且经过多次努力让它认识到某些文件确实存在于他们认为存在的确切位置。我现在正在

更新

17:06:42 **** Incremental Build of configuration Default for project OmegaDice ****
"C:\\android-ndk-r8e\\ndk-build.cmd" V=1 clean all all 
FIND: Parameter format not correct
Clean: SDL2 [armeabi]
Clean: SDL2_ttf [armeabi]
Clean: freetype [armeabi]
Clean: main [armeabi]
Clean: stlport_shared [armeabi]
Clean: stlport_static [armeabi]
del /f/q .\libs\armeabi\libSDL2.so    >NUL 2>NUL
Install        : libSDL2.so => libs/armeabi/libSDL2.so
copy /b/y ".\obj\local\armeabi\libSDL2.so" ".\libs\armeabi\libSDL2.so" > NUL
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded  ./libs/armeabi/libSDL2.so
"Compile thumb : SDL2_ttf <= SDL_ttf.c
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-gcc -MMD -MP -MF ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Ijni/SDL_ttf -Ijni/SDL_ttf/../SDL/include -Ijni/SDL_ttf/../freetype/include -Ijni/SDL_ttf/include -IC:/android-ndk-r8e/sources/cxx-stl/stlport/stlport -IC:/android-ndk-r8e/sources/cxx-stl//gabi++/include -Ijni/SDL_ttf -DANDROID -Os -Wa,--noexecstack  -IC:/android-ndk-r8e/platforms/android-14/arch-arm/usr/include -c  jni/SDL_ttf/SDL_ttf.c -o ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o 
SharedLibrary  : libSDL2_ttf.so
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++ -Wl,-soname,libSDL2_ttf.so -shared --sysroot=C:/android-ndk-r8e/platforms/android-14/arch-arm ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o ./obj/local/armeabi/libfreetype.a -lgcc ./obj/local/armeabi/libSDL2.so -no-canonical-prefixes  -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now  -LC:/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib -lz -lc -lm -o ./obj/local/armeabi/libSDL2_ttf.so
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:590: error: undefined reference to 'FT_Get_Char_Index'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:592: error: undefined reference to 'FT_Load_Glyph'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:656: error: undefined reference to 'FT_Outline_Transform'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:662: error: undefined reference to 'FT_Get_Glyph'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:663: error: undefined reference to 'FT_Stroker_New'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:667: error: undefined reference to 'FT_Stroker_Set'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:669: error: undefined reference to 'FT_Glyph_Stroke'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:671: error: undefined reference to 'FT_Stroker_Done'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:673: error: undefined reference to 'FT_Glyph_To_Bitmap'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:676: error: undefined reference to 'FT_Done_Glyph'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:682: error: undefined reference to 'FT_Render_Glyph'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function Find_Glyph:jni/SDL_ttf/SDL_ttf.c:885: error: undefined reference to 'FT_Done_Glyph'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_Init:jni/SDL_ttf/SDL_ttf.c:334: error: undefined reference to 'FT_Init_FreeType'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_CloseFont:jni/SDL_ttf/SDL_ttf.c:915: error: undefined reference to 'FT_Done_Face'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_OpenFontIndexRW:jni/SDL_ttf/SDL_ttf.c:420: error: undefined reference to 'FT_Open_Face'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_OpenFontIndexRW:jni/SDL_ttf/SDL_ttf.c:442: error: undefined reference to 'FT_Set_Charmap'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_OpenFontIndexRW:jni/SDL_ttf/SDL_ttf.c:448: error: undefined reference to 'FT_Set_Char_Size'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_OpenFontIndexRW:jni/SDL_ttf/SDL_ttf.c:457: error: undefined reference to 'FT_MulFix'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_OpenFontIndexRW:jni/SDL_ttf/SDL_ttf.c:458: error: undefined reference to 'FT_MulFix'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_OpenFontIndexRW:jni/SDL_ttf/SDL_ttf.c:460: error: undefined reference to 'FT_MulFix'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_OpenFontIndexRW:jni/SDL_ttf/SDL_ttf.c:462: error: undefined reference to 'FT_MulFix'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_OpenFontIndexRW:jni/SDL_ttf/SDL_ttf.c:474: error: undefined reference to 'FT_Set_Pixel_Sizes'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_GlyphIsProvided:jni/SDL_ttf/SDL_ttf.c:1103: error: undefined reference to 'FT_Get_Char_Index'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_SizeUTF8:jni/SDL_ttf/SDL_ttf.c:1204: error: undefined reference to 'FT_Get_Kerning'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_RenderUTF8_Solid:jni/SDL_ttf/SDL_ttf.c:1390: error: undefined reference to 'FT_Get_Kerning'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_RenderUTF8_Shaded:jni/SDL_ttf/SDL_ttf.c:1568: error: undefined reference to 'FT_Get_Kerning'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_RenderUTF8_Blended:jni/SDL_ttf/SDL_ttf.c:1732: error: undefined reference to 'FT_Get_Kerning'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/SDL2_ttf/SDL_ttf.o: in function TTF_Quit:jni/SDL_ttf/SDL_ttf.c:2140: error: undefined reference to 'FT_Done_FreeType'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libSDL2_ttf.so] Error 1

17:07:20 Build Finished (took 37s.757ms)

JNI / SDL_ttf / Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := SDL2_ttf
FREETYPE := $(LOCAL_PATH)/freetype
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/../SDL/include $(LOCAL_PATH)/../freetype/include $(LOCAL_PATH)/include

LOCAL_CFLAGS := -Os

LOCAL_CPP_EXTENSION := .cpp

LOCAL_SRC_FILES := SDL_ttf.c

LOCAL_SHARED_LIBRARIES := SDL2
LOCAL_STATIC_LIBRARIES := freetype
LOCAL_LDLIBS := -lz

include $(BUILD_SHARED_LIBRARY)

因此,如果有人对于为什么会发生这种情况有任何有用的建议,或者如何修复它将非常感激。

1 个答案:

答案 0 :(得分:0)

问题在于:

FIND: Parameter format not correct

因此不会编译freetype。

您正在Windows中构建,因此正在执行的find命令是Windows版本,它具有不同的语法。

您需要下载与{1}程序具有相同语法的find程序。 例如从这里: http://unxutils.sourceforge.net/

然后你需要强制使用freetype Android.mk来使用新的find

变化:

APP_SUBDIRS := $(patsubst $(LOCAL_PATH)/%, %, $(shell find $(LOCAL_PATH)/src -type d))

APP_SUBDIRS := $(patsubst $(LOCAL_PATH)/%, %, $(shell PATH_TO_UNIXLIKE_FIND\find $(LOCAL_PATH)/src -type d))

e.g。

APP_SUBDIRS := $(patsubst $(LOCAL_PATH)/%, %, $(shell c:\unixtools\usr\local\wbin\find $(LOCAL_PATH)/src -type d))