如何修复 NanoPB MyProtocol.proto: Option (nanopb) unknown
问题:
尝试使用 NanoPB 编译项目时,你看到类似这样的警告
nanopb_import_fix.txt
MyProtocol.proto:11:27: Option "(nanopb)" unknown. Ensure that your proto definition file imports the proto which defines the option.解决方案
在警告消息中提到的 .proto 文件顶部,在 syntax = "proto3"; 之后添加以下行:
import_nanopb_proto_fix.proto
import "nanopb.proto";之后,错误应该消失。
Check out similar posts by category:
NanoPB
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow