when I try to compile my .proto to python and cpp, I get the following:
$ protoc --python_out=./py_msgs --cpp_out=./cpp_msgs ./spm.proto
google/protobuf/any.proto: File not found.
spm.proto:4:1: Import "google/protobuf/any.proto" was not found or had
errors.
spm.proto:228:3: "google.protobuf.Any" is not defined.
$
Code:
syntax = "proto3";
package myMessages;
import "google/protobuf/any.proto"; // line 4
...// skip a bunch of lines where I define sub messages and enums
message SpmMyMessage { // line 226
MessageIdType ID = 1; // an enum
google.protobuf.Any body = 2;
}
System:
Redhat 7.6
kernel 3.10.0-957.10.1.el7.x86_64
When I did the make install, it didn't finish, so I had to finish "by
hand", and here is what I did:
tar -xvf protobuf-all-3.10.1.tar.gz
cd protobuf-3.10.1
./configure
make -j
make check
sudo make install # fails, so need to execute the following extra commands
cd src/.libs
sudo cp libprotobuf.a /usr/local/lib
sudo cp libprotobuf-lite.a /usr/local/lib
sudo cp libprotoc.a /usr/local/lib
sudo cp libprotoc.la /usr/local/lib
sudo cp libprotoc.so.21.0.1 /usr/local/lib
sudo cp protoc /usr/local/bin
cd /usr/local/lib
sudo ln -s libprotoc.so.21.0.1 libprotoc.so
sudo ln -s libprotoc.so.21.0.1 libprotoc.so.21
Python modules installed:
sudo pip3 install --trusted-host pypi.org clint zmq mock pyserial google
protobuf protobuf3
Does anyone know what I'm doing wrong? If I look in the unzipped source,
in src/google/protobuf/ there are a bunch of non-test .proto files. I just
don't know if they need to be copied somewhere as well. I'm thinking my
failed install also failed to copy those files.
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/02cb56fc-c2fd-442b-b689-da12c59e85c7%40googlegroups.com.