Protobuf: Import "google/protobuf/descriptor.proto" was not found or had errors.

Created on 3 Sep 2018  路  5Comments  路  Source: golang/protobuf

When I compile a proto file, it came out this error.
I already place "protoc" in PATH and copy the contents of the 'include' directory into '/usr/local/include/'.

question waiting-for-info

Most helpful comment

IIRC, protoc looks for includes relative to the protoc binary. So if protoc is in /usr/local/bin, then it will look in /usr/local/include.

All 5 comments

Does this work if you invoke protoc explicitly with that include path?

protoc -I/usr/local/include $ARGS

If that doesn't work, what are contents of /usr/local/include/google/protobuf?

Closing as stale. Reply on the issue if it doesn't fix the problem and we can discuss further.

Does this work if you invoke protoc explicitly with that include path?

protoc -I/usr/local/include $ARGS

If that doesn't work, what are contents of /usr/local/include/google/protobuf?

It worked for me. However, it should work without explicitly providing "include" folder, right? am I missing some configuration. Thanks for your reply and time.

am I missing some configuration.

Possibly? I'm not sure where protoc checks to know where to derive the default list of include paths. That's a question better asked on https://github.com/protocolbuffers/protobuf

IIRC, protoc looks for includes relative to the protoc binary. So if protoc is in /usr/local/bin, then it will look in /usr/local/include.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seungryulchoisc picture seungryulchoisc  路  3Comments

junghoahnsc picture junghoahnsc  路  5Comments

sitano picture sitano  路  4Comments

zamberform picture zamberform  路  5Comments

lofcek picture lofcek  路  6Comments