Reputation: 33
I am trying to build sphinxbase library but it keeps giving following error:
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/base/__/__/__/__/__/src/libsphinxbase/util/SingletonLogMath.o: in function boost::thread_exception::thread_exception(int, char const*):C:\sdk/include/boost/thread/exceptions.hpp:51: error: undefined reference to 'boost::system::system_category()'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/base/__/__/__/__/__/src/libsphinxbase/util/SingletonLogMath.o: in function _GLOBAL__sub_I_SingletonLogMath.cpp:C:\sdk/include/boost/system/error_code.hpp:222: error: undefined reference to 'boost::system::generic_category()'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/base/__/__/__/__/__/src/libsphinxbase/util/SingletonLogMath.o: in function _GLOBAL__sub_I_SingletonLogMath.cpp:C:\sdk/include/boost/system/error_code.hpp:223: error: undefined reference to 'boost::system::generic_category()'
C:/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/base/__/__/__/__/__/src/libsphinxbase/util/SingletonLogMath.o: in function _GLOBAL__sub_I_SingletonLogMath.cpp:C:\sdk/include/boost/system/error_code.hpp:224: error: undefined reference to 'boost::system::system_category()'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libbase.so] Error 1
I searched over the internet and all I can found is that I should add boost-system library, also they says that it is important to use include the dependencies in the correct order. But I don't know what is the correct order.
Here is the part of android.mk file that might be important.
include $(CLEAR_VARS)
LOCAL_MODULE := boost_thread
LOCAL_SRC_FILES := lib/libboost_thread_pthread-gcc-mt-1_54.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := boost_system
LOCAL_SRC_FILES := lib/libboost_system-gcc-mt-1_54.a
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_PATH := $(MY_LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../../src/libsphinxbase/fe $(LOCAL_PATH)/../../../../../src/libsphinxbase/fe $(LOCAL_PATH)/../../../../../include/android $(LOCAL_PATH)/../../../../../include $(SDK)/include
LOCAL_CFLAGS += -DHAVE_CONFIG_H
LOCAL_CPPFLAGS += -fexceptions -frtti
LOCAL_ARM_MODE := arm
...sources...
LOCAL_STATIC_LIBRARIES := boost_system, boost_thread
What should be the right order?
Upvotes: 3
Views: 1589
Reputation: 210
LOCAL_STATIC_LIBRARIES := boost_system, boost_thread
you should remove the ','
LOCAL_STATIC_LIBRARIES := boost_system boost_thread
Upvotes: 2