problem porting ttf library to android.

closed account (N8RzwA7f)
hello all.

I'm having some trouble with porting the ttf library to android.

I installed the source/header/android.mk file in it's own SDL2_ttf folder in jni (sdl2/androidprojects/jni/sdl2_ttf). So glfont.c , sdl_ttf.c, sdl_ttf.h,showfont.c , and ft2build.h inside sdl2_ttf. Then inside the sdl2_ttf directory I added the freetype folder with the config , internal , and src folders .
I added the src folder to the freetype folder , as I think that was needed. it was first in the external folder?

i changed the jni/src/android.mk to include the local paths:
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include $(LOCAL_PATH)/../SDL2_image $(LOCAL_PATH)/$(SDL_PATH)/include $(LOCAL_PATH)/../SDL2_mixer $(LOCAL_PATH)/$(SDL_PATH)/include $(LOCAL_PATH)/../SDL2_ttf
and local shared libraries:
LOCAL_SHARED_LIBRARIES := SDL2 SDL2_image SDL2_mixer SDL2_ttf


I also updated the android.mk file in jni/sdl2_ttf :
FREETYPE_LIBRARY_PATH := ../freetype


But I get this error when running ndk-build:
no rule to make target /src/autofit/autofit.c , needed by obj/local/armeabi/objs/SDl2_ttf //src/autofit/autofit.o stop.


what did I do wrong ? :)

thanks!
closed account (N8RzwA7f)
Anyone know ? I'm totally stuck , i've been at it a week now almost porting all these libaries :(
Where is autofit.c?

There is a suspicious prefixed slash on /src/autofit/autofit.c: have you added an extra slash somewhere?
Last edited on
closed account (N8RzwA7f)
autofit.c is in the sdl2/androidprojects/jni/sdl2_ttf/freetype/src/autofit folder
I don't think I added an extra slash , how could something like that happen?

thanks :)
how could something like that happen?

When I do this it's usually caused by trying to build a path using macros - something like
${FOO}/bar.txt
but ${FOO} ends with a trailing slash by mistake, or is empty.

As it is right now make is looking for autofit.c in /src/autofit/ -- this is an absolute path.

There is a similar problem in the error message you reported: //src/autofit/autofit.o

Apparently autofit.c is part of libfreetype. Judging from here
https://github.com/emscripten-ports/SDL2_ttf/blob/master/Android.mk
My guess is that
FREETYPE_LIBRARY_PATH := ../freetype
is incorrect.

Edit:
autofit.c is in the sdl2/androidprojects/jni/sdl2_ttf/freetype/src/autofit folder

Try changing FREETYPE_LIBRARY_PATH to ./freetype or move the freetype folder up one level.
Last edited on
closed account (N8RzwA7f)
I tried what you suggested but it didn't work ? I moved the freetype folder up one level , with FREETYPE_LIBRARY_PATH := ../freetype the same.

hope you have some ideas still :)
Last edited on
Topic archived. No new replies allowed.