解决proto文件转换时提示“Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it. ”

前言:

想将.proto文件转换成.pb文件时一直报错,一开始以为是文件编码格式的问题,后来将文件改成windows下的utf-8格式后,又出现了新的报错(见下图)。百度了很久,才找到解决方法。

这个报错的意思是:“building_produce”在“WNet”整个文件中必须是唯一的,而不仅仅是在“open_case_type”这个menu中唯一。

所以说这个menu speed_up_target_type中的building_produce在其他地方也有个同名的。

果然搜索后发现有个message building_produce

解决方法:

将enum里的building_produce改个名字咯

猜你喜欢

转载自www.cnblogs.com/lucio1128/p/12814032.html