Hi everyone,
I tried to cross-compile protobuf-cpp-3.10.0 on Linux SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
The steps I did are
$ ./configure --host=x86-linux --target=aarch64-linux-gnu CXX=arm-linux-gnueabihf-g++ --with-protoc=../protoc-3.10.0/bin/protoc
$ make
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
$ sudo ldconfig
It did build the libprotobuf.so.21.0.0 shared lib under ../ protobuf-3.10.0/src/.libs and installed under /usr/local/lib
It also create protoc under ../ protobuf-3.10.0/src/.libs
$ file libprotobuf.so.21.0.0
libprotobuf.so.21.0.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked,
$ file protoc
protoc: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked
When I tried to use protoc to compile proto file I got the following ERROR
$ protoc BIT.proto
protoc: error while loading shared libraries: libprotobuf.so.21: wrong ELF class: ELFCLASS32
I can't use the protoc from protoc-3.10.0-linux-aarch_64.zip as it is ELF 64bits
What do I missed here? What wrong with ELFCLASS32. My libprotobuf.so and protoc are both ELF 32 bits
Any help are very appreciated.
Is there any protobuf compiler for ARM 32 bits? I found only protoc-3.10.0-linux-aarch_64.zip
Thanks
-Tom