makefile 执行 protoc 报 google/protobuf/timestamp.proto: File not found. 的错

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 调用 程序的时候 报错 , 试试看 写 程序的完整路径

posted @ 2022-02-26 11:31  ifnk  阅读(1736)  评论(0编辑  收藏  举报