shell - Using the glib on Android : undefined reference to 'g_thread_init' -
i trying compile module android using ndk. library has dependency on glib, built using https://github.com/ieei/glib, , seemed ok. however, when try use glib module in android.mk file following on running ndk-build:
jni/fluidsynth/fluidsynth/fluidsynth/src/fluid_cmd.c:1837: error: undefined reference 'g_thread_init' jni/fluidsynth/fluidsynth/fluidsynth/src/fluid_event.c:647: error: undefined reference 'g_thread_init' jni/fluidsynth/fluidsynth/fluidsynth/src/fluid_midi_router.c:106: error: undefined reference 'g_thread_init' jni/fluidsynth/fluidsynth/fluidsynth/src/fluid_sys.h:161: error: undefined reference 'g_thread_init'
i looked solutions problem, , found this: http://ragnermagalhaes.blogspot.com/2007/09/undefined-reference-to-gthreadinit.html, couldn't seem either of proposed solutions me (possibly because pretty new whole makefile thing)
my android.mk: local_path := $(call my-dir)
include $(clear_vars) local_c_includes := $(local_path)/../pdcore/jni/libpd/pure-data/src \ $(local_path)/../glib \ $(local_path)/../glib/glib \ $(local_path)/../glib/gnulib \ $(local_path)/../glib/android \ $(local_path)/fluidsynth/fluidsynth/fluidsynth/include/fluidsynth \ $(local_path)/fluidsynth/fluidsynth/fluidsynth/include local_module := soundfonts local_cflags := -dpd local_cflags += -std=c11 local_cflags += -w local_cflags += fluid_src := $(wildcard $(local_path)/fluidsynth/fluidsynth/fluidsynth/src/*.c) local_src_files := $(fluid_src:$(local_path)/%=%) \ soundfonts.c local_ldlibs := $(local_path)/../glib/libs/armeabi/libglib-2.0.so local_ldlibs += -l$(local_path)/../pdcore/libs/$(target_arch_abi) -lpd -lgthread-2.0 -lglib-2.0 include $(build_shared_library)
anybody have ideas how rid of linker errors? thanks.
i figured out! there several shared object libraries being created when build glib, , 1 missing libgthread-2.0.so.
i added libgthread-2.0.so local_ldlibs , worked
Comments
Post a Comment