Skip to content

Cross compiling protobuf for ARM architecture

calligaris edited this page Dec 20, 2012 · 1 revision

In order to cross compile Google protobuffers for ARM on linux you need to download and install the packages for

  • arm-linux-gnueabi-gcc
  • arm-linux-gnueabi-g++.

The first step is building a native (x86) version of the protobuf libraries and compiler (protoc) since the native compiler is necessary to build the test applications even if you're compiling for a different architecture:

  • Run the ./configure script without argument from /edcexamples/edc-c-client/protobuf than run make from /edcexamples/edc-c-client/protobuf/src. If everything works you should find the protoc executable in /edcexamples/edc-c-client/protobuf/src/.libs
  • Copy the protoc executable somewhere (for example in /usr/bin)

In order to build the protobuf libraries and test applications for ARM:

  • Run again the ./configure script with the command line --host=arm-linux CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++ --with-protoc=/usr/bin/protoc
  • Run make from /edcexamples/edc-c-client/protobuf/src
Clone this wiki locally