我正在尝试构建sphinxbase库,但它不断发出以下错误:
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
我通过互联网搜索,我所能找到的是我应该添加boost-system库,他们也说使用正确顺序包含依赖项很重要。 但我不知道正确的顺序是什么。
这是android.mk文件中可能很重要的部分。
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
什么是正确的顺序?
答案 0 :(得分:2)
LOCAL_STATIC_LIBRARIES := boost_system, boost_thread
您应该删除','
LOCAL_STATIC_LIBRARIES := boost_system boost_thread