I'm trying to get Protobuf lib to communicate between Java And JNI layer in Android. I get source code guided from here. So I added this as source file in Jni>Source_Sirectory. Now if I perform ndk-build to generate .so file then it prompt following error Log:
[armeabi] SharedLibrary : libprotobuf-lite.so
jni/src/google/protobuf/stubs/common.cc:201: error: undefined reference to 'google::protobuf::util::Status::ToString() const'
jni/src/google/protobuf/stubs/common.cc:207: error: undefined reference to 'google::protobuf::operator<<(std::ostream&, google::protobuf::uint128 const&)'
jni/src/google/protobuf/arena.h:622: error: undefined reference to 'google::protobuf::Arena::AllocateAligned(std::type_info const*, unsigned int)'
jni/src/google/protobuf/arena.h:624: error: undefined reference to 'google::protobuf::Arena::AddListNode(void*, void (*)(void*))'
jni/src/google/protobuf/arena.h:462: error: undefined reference to 'google::protobuf::Arena::AddListNode(void*, void (*)(void*))'
jni/src/google/protobuf/arena.h:617: error: undefined reference to 'google::protobuf::Arena::AllocateAligned(std::type_info const*, unsigned int)'
jni/src/google/protobuf/arena.h:617: error: undefined reference to 'google::protobuf::Arena::AllocateAligned(std::type_info const*, unsigned int)'
jni/src/google/protobuf/arena.h:617: error: undefined reference to 'google::protobuf::Arena::AllocateAligned(std::type_info const*, unsigned int)'
jni/src/google/protobuf/arena.h:633: error: undefined reference to 'google::protobuf::Arena::AddListNode(void*, void (*)(void*))'
jni/src/google/protobuf/arena.h:624: error: undefined reference to 'google::protobuf::Arena::AddListNode(void*, void (*)(void*))'
jni/src/google/protobuf/wire_format_lite.cc:514: error: undefined reference to 'google::protobuf::internal::IsStructurallyValidUTF8(char const*, int)'
jni/src/google/protobuf/wire_format_lite.cc:527: error: undefined reference to 'google::protobuf::StringPrintf(char const*, ...)'
collect2: error: ld returned 1 exit status
Any suggestion if I'm missing anything here?