我正在使用NDK build&看到这个奇怪的链接器错误:
./external/stlport/stlport/stl/_fstream.c:139: error: undefined reference to 'std::_Filebuf_base::_M_seek(long long, int)'
./external/stlport/stlport/stl/_fstream.c:391: error: undefined reference to 'std::_Filebuf_base::_M_seek(long long, int)'
./external/stlport/stlport/stl/_fstream.c:120: error: undefined reference to 'std::_Filebuf_base::_M_unmap(void*, long long)'
./external/stlport/stlport/stl/_fstream.c:320: error: undefined reference to 'std::_Filebuf_base::_M_seek(long long, int)'
./external/stlport/stlport/stl/_fstream.c:336: error: undefined reference to 'std::_Filebuf_base::_M_seek(long long, int)'
./external/stlport/stlport/stl/_fstream.c:120: error: undefined reference to 'std::_Filebuf_base::_M_unmap(void*, long long)'
./external/stlport/stlport/stl/_fstream.c:120: error: undefined reference to 'std::_Filebuf_base::_M_unmap(void*, long long)'
./external/stlport/stlport/stl/_fstream.c:120: error: undefined reference to 'std::_Filebuf_base::_M_unmap(void*, long long)'
collect2: error: ld returned 1 exit status
我得到了fstream.o&的objdump输出我确实看到了这个_M_seek()函数。任何想法为什么它仍然无法找到它。以下是我的Android.mk中的一些条目:
LOCAL_C_INCLUDES += $(TOP)/external/stlport/stlport \
$(TOP)/bionic/libstdc++/include \
$(TOP)/bionic \
LOCAL_CFLAGS += -std=gnu++11 -std=c++11
LOCAL_CPPFLAGS := -std=gnu++11 -std=c++11
LOCAL_SHARED_LIBRARIES := libcutils liblog libutils libstlport
我错过了什么吗?
答案 0 :(得分:0)
看看你是否在Android.mk文件中定义了_LARGEFILE_SOURCE。如果已经定义,删除它可以解决问题。