stlport related unresolved external

290 views Asked by At

I'm using NDK build & seeing this weird linker error:

./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

I got the objdump output of fstream.o & I do see this _M_seek() function. Any ideas why it's still not able to find it. Here are some entries in my 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

Am I missing anything?

1

There are 1 answers

0
Huiyong Chen On

See if you defined _LARGEFILE_SOURCE in your Android.mk file. If it had been defined, remove it can solve the problem.