I'm trying to build the compile environment of .proto files for grpc on my macbook. My current local protobuf version is 3.11.4 in my iOS project, but the latest grpc direct to protobuf 3.15.8. I have customized my protobuf code for some reason, so I don't want to upgrade it, and so does the compile environment.
my question is: can I keep my local old version protobuf(3.11.4) environment while install grpc environment at the same time?
When I use pod install to generate xx.pbobjc.h xx.pbobjc.m xx.pbrpc.h xx.pbrpc.m, it shows an error in the file
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
and when I use cmd in terminal like this
protoc -I . --objc_out=./output --grpc_out=./output --plugin=protoc-gen-grpc=grpc_objective_c_plugin search.proto
it goes
dyld: Library not loaded: /usr/local/opt/protobuf/lib/libprotoc.26.dylib
Referenced from: /Users/rose/Documents/Code/JobProjects/grpcProto/grpc_objective_c_plugin
Reason: image not found
looks like it has linked to a higher version protobuf.
here's my protobuf version
$ protoc --version
libprotoc 3.11.4
'brew install grpc' dependent the latest protobuf(3.15.8), I guess I should clone grpc down and build the environment by myself and so I did, but it seems grpc doesn't link with my old protobuf still when I try to generate code from .proto file, can anybody tell me how to make it happen? Have I make this clear? please tell me if i don't