Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Android.mk mentioned above works fine, thanks a lot.</p> <p>I would like to describe all the steps for building protobuf for android.</p> <ul> <li><p>Configure sources for android. Use the following script (got it here: <a href="http://habrahabr.ru/post/119693/" rel="nofollow">http://habrahabr.ru/post/119693/</a>):</p> <p>PREBUILT=/Users/user/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3</p> <p>PLATFORM=/Users/user/android-ndk-r7b/platforms/android-3/arch-arm/</p> <p>export CC="/Users/user/android-ndk-r7b/toolchains/arm-linux-androideabi- 4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc"</p> <p>export CFLAGS="-fPIC -DANDROID -nostdlib"</p> <p>export ANDROID_ROOT="/Users/user/android-ndk-r7b"</p> <p>export LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/platforms/android-3/arch-arm/usr/lib/ -L$ANDROID_ROOT/platforms/android-3/arch-arm/usr/lib/"</p> <p>export CPPFLAGS="-I$ANDROID_ROOT/platforms/android-3/arch-arm/usr/include/"</p> <p>export LIBS="-lc "</p> <p>./configure --host=arm-eabi </p></li> <li><p>Delete the following lines from mentioned above Android.mk file:</p> <pre><code>src/google/protobuf/stubs/strutil.cc \ src/google/protobuf/stubs/substitute.cc \ src/google/protobuf/stubs/structurally_valid.cc \ src/google/protobuf/descriptor.cc \ src/google/protobuf/descriptor.pb.cc \ src/google/protobuf/descriptor_database.cc \ src/google/protobuf/dynamic_message.cc \ src/google/protobuf/extension_set_heavy.cc \ src/google/protobuf/generated_message_reflection.cc \ src/google/protobuf/message.cc \ src/google/protobuf/reflection_ops.cc \ src/google/protobuf/service.cc \ src/google/protobuf/text_format.cc \ src/google/protobuf/unknown_field_set.cc \ src/google/protobuf/wire_format.cc \ src/google/protobuf/io/gzip_stream.cc \ src/google/protobuf/io/printer.cc \ src/google/protobuf/io/tokenizer.cc \ src/google/protobuf/io/zero_copy_stream_impl.cc \ src/google/protobuf/compiler/importer.cc \ src/google/protobuf/compiler/parser.cc </code></pre> <p>It is needed for building lite version of library. Unfortunately full version of the lib works just from Android 2.3. I tested lite version for Android 1.6, 2.1, 2.3.</p></li> <li>build the library using ndk-build.</li> <li>for generating c++ files (using protoc compiler) for the lite library it is needed to include: option optimize_for = LITE_RUNTIME; in .proto file.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload