c++ - How to build lib protobuf along with dynamic library for use in Android application? -


i'm trying compile open source project (let's foo) libfoo.so native library use android app. however, project uses google's protocol buffer library.

so able compile google's lib protobuf ios follows: https://gist.github.com/bennettsmith/7150245 .

however, generates libprotobuf.a file. problem can't seem figure out way include libprotobuf.a file libfoo.so file use android application. thought had referenced when did:

include $(clear_vars) local_module    := libprotobuf local_src_files := ./src/lib/libprotobuf.a local_export_c_includes := ./src/include include $(prebuilt_static_library) 

in android.mk file. however, seems not getting linked properly. whenever try ndk-build open source project (which depends on using lib protobuf), bunch of undefined references, like:

undefined reference 'google::protobuf::internal::empty_string_' 

so thought maybe i'm not supposed have symbols defined here? maybe i'm supposed first compile libfoo.so file, , somehow link lib protobuf libprotobuf.a or libprotobuf.so ?? ended using local_allow_undefined_symbols := true project generate libfoo.so file.

but libfoo.so gives me load error try use within android app:

dlopen failed: cannot locate symbol "_zn6google8protobuf11messagelite15parsefromstringerkss" referenced libfoo.so 

so i'm wondering:

  • how include protobuf library in android app?
  • do try include protobuf library libfoo.so first?
  • would work if tried ignore linker warnings , tried generate libprotobuf.so , include application?
  • is possible generate libprotobuf.so? can't generate using instructions on github - ton of errors

note reason i'm able undefined reference errors when trying generate libfoo.so because manually copied of *.h in google's lib protobuf.

any appreciated!!!


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -