I am unable to get beyond the make protobuf
step due to the error below. I read up some blogs, they recommended installing brew install protobuf
. Did that. Still not able to build.
I am building on a Mac 10.11.6
make protobuf_dist
c++ -MD -c -o /Users/jsiddharth/Desktop/workspace/test/j2objc-master/protobuf/compiler/build_result/google/protobuf/compiler/j2objc/j2objc_enum.o -x c++ -stdlib=libc++ -Isrc -I../google/src src/google/protobuf/compiler/j2objc/j2objc_enum.cc
In file included from src/google/protobuf/compiler/j2objc/j2objc_enum.cc:35:
In file included from src/google/protobuf/compiler/j2objc/j2objc_enum.h:41:
src/google/protobuf/compiler/j2objc/common.h:44:10: fatal error:
'google/protobuf/compiler/code_generator.h' file not found
#include <google/protobuf/compiler/code_generator.h>
^
1 error generated.
make[1]: *** [/Users/jsiddharth/Desktop/workspace/test/j2objc-master/protobuf/compiler/build_result/google/protobuf/compiler/j2objc/j2objc_enum.o] Error 1
make: *** [protobuf_compiler_dist] Error 2
Edit
I tried to export to
export PROTOBUF_ROOT_DIR=~/Downloads/protobuf-3.0.0/src/
Since I found the code_generator.h in
/Users/jsiddharth/Downloads/protobuf-3.0.0/src/google/protobuf/compiler/code_generator.h
Still the same error. Am I not exporting the correct variable ?
Edit
For a Mac system, Unix tools are not available by default. You will first need to install Xcode from the Mac AppStore and then run the following command from a terminal:
$ sudo xcode-select --install
To install Unix tools, you can install "port" following the instructions at https://www.macports.org . This will reside in /opt/local/bin/port for most Mac installations.
$ sudo /opt/local/bin/port install autoconf automake libtool
Now I am facing the following error
/Users/jsiddharth/Desktop/workspace/test/j2objc-master/protobuf/compiler/build_result/google/protobuf/stubs/strutil.o /usr/local/lib//libprotobuf.a(strutil.o) ld: 55 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: * [/Users/jsiddharth/Desktop/workspace/test/j2objc-master/protobuf/compiler/build_result/j2objc_protoc] Error 1 make: * [protobuf_compiler_dist] Error 2