作者:吉祥二宝 | 来源:互联网 | 2023-05-23 13:06
protobuf文件里面引用了谷歌的时间戳importgoogleprotobuftimestamp.protomakefile文件这样看没什么问题……然后执行makegrpc-g
protobuf 文件 里面 引用了 谷歌的时间戳 import "google/protobuf/timestamp.proto"
makefile 文件
这样看没什么问题…… 然后 执行 make grpc-go
结果报这个错……
$ make grpc-go | xsel -ib
google/protobuf/timestamp.proto: File not found.
user.proto:6:1: Import "google/protobuf/timestamp.proto" was not found or had errors.
user.proto:14:3: "google.protobuf.Timestamp" is not defined.
user.proto:15:3: "google.protobuf.Timestamp" is not defined.
make: *** [Makefile:15:grpc-go] 错误 1
说谷歌 的 timestamp.proto 没找到 , 百度了 半天 没有结果
后来 想看看 protoc 是哪个 输入 了 whereis protoc
$ whereis protoc
protoc: /usr/bin/protoc /home/ifnk/go/bin/protoc
竟然有两个路径 ……
写全路径 试试
还是报错
换 /ust/bin/protoc 的 试试
成功 了 ,不报错 了 ,下次 makefile 调用 程序的时候 报错 , 试试看 写 程序的完整路径
原文链接:https://www.cnblogs.com/ifnk/p/15938834.html