我在构建过程中遇到这样的错误:e:/Users/some/path/SomeClass.java:86:error:cannotfindsymbole:e:staticConnectionTypegetConnectionType(Contextcontext){e:^e:symbol:classConnectionTypee:location:classSomeClass其中ConnectionType是protobuf生成的类。所以看起来kapt不能解析生成的类。我尝试了什么?一开始我添加了kotlin-apt插件:applyplugin:'kotlin-kapt'然后我将brot
我在构建过程中遇到这样的错误:e:/Users/some/path/SomeClass.java:86:error:cannotfindsymbole:e:staticConnectionTypegetConnectionType(Contextcontext){e:^e:symbol:classConnectionTypee:location:classSomeClass其中ConnectionType是protobuf生成的类。所以看起来kapt不能解析生成的类。我尝试了什么?一开始我添加了kotlin-apt插件:applyplugin:'kotlin-kapt'然后我将brot
我正在使用protobuf-embedded-c在小型系统上将不同的数据从它传输到PC。问题是,如果我在两端都使用嵌入式库,一切正常。如果我在PC上使用谷歌C++,它就不再工作了。我想我将问题追溯到每条消息中都有长度前缀的嵌入式库,但我似乎无法在C++库上以一种好的方式做到这一点。这是我用来调试它的测试应用程序:人.proto:enumPhoneType{MOBILE=0;HOME=1;WORK=2;}messagePhoneNumber{requiredfloatnumber=1;requiredPhoneTypetype=2;}主要.cpp:#include#include#def
我们有一些(很多).NET类。我们使用了protobuf-net标记它们,并通过googleoriginallibrary为C++代码端生成.proto包装器.所以我有一条消息(某些EventBase类上的C++DebugString()(在.NETEventCharacterMoved中继承EventBase而在C++中我只写入可选属性)):UserId:-2792EventCharacterMoved{Coordinates{Position{X:196.41913Y:130Z:213}Rotation{X:207Y:130Z:213}}OldCoordinates{Positio
我正在使用protobuf和Linux。它的编译器protoc在哪里?我已经从主站点下载了这个包,编译并成功安装了它,但是我找不到protoc来构建我自己的格式文件。它在哪里?更新这是我构建protobuf的文件夹:aclocal.m4depcompMakefile.inautogen.sheditorsmissingCHANGES.txtexamplesprotobuf-lite.pcconfig.guessgenerate_descriptor_proto.shprotobuf-lite.pc.inconfig.hgtestprotobuf.pcconfig.h.ininstall
我应该如何在Protobuf消息中添加方法?假设我的.proto文件中有:packageproto;messagePerson{requiredstringname=1;requiredint32id=2;optionalstringemail=3;}我想添加一个方法,例如,字符串concatenateNameEmail()到消息中。我现在做的是像这样创建自己的C++类:classPerson:publicproto::Person{public:Person(proto::Personconst&person_):proto::Person(person_){}stringconca
我目前收到一个错误,它指向protoc生成的头文件中的这些行:#if2006001但我的协议(protocol)版本与上面的版本匹配:protoc--versionlibprotoc2.6.1我做错了什么?最初我的protoc版本是3.0.0然后通过同步回2.6.1并执行这些步骤重新安装它;makedistclean,./configure,make,makeinstall安装所需的2.6.1版本。我需要旧版本,因为那是我们服务器中安装的版本。 最佳答案 问题是您系统上安装的header(在/usr/include/google/p
当我尝试解析大消息时收到此警告和错误。我知道64MB是默认限制。我现在正在使用message.ParseFromIstream。有谁知道访问CodedInputStream对象以调用SetTotalBytesLimit函数?或任何其他方式来解决这个问题?Readingdangerouslylargeprotocolmessage.Ifthemessageturnsouttobelargerthan67108864bytes,parsingwillbehaltedforsecurityreasons.Toincreasethelimit(ortodisablethesewarnings)
我下载源Protobufzip文件。然后我打开我的ClassicEclipse并选择File->Import->ExistingMavenProjects。我选择根文件夹为/java。显示pom.xml已经勾选,选择Next。屏幕显示:SetupMavenpluginconnectors:withmaven-antrun-plugin:1.3:run(2errors):Nomarketplaceentriesfoundtohandlemaven-antrun-plugin:1.3:runinEclipse.PleaseseeHelpformoreinformation.我是不是漏掉了什
我正在尝试使用Gradle构建一个同时使用GoogleProtocolBuffer和Kotlin的项目。我希望将proto文件编译成Java源代码,然后从我的Kotlin代码中调用它。我的源文件是这样排列的:src/main/proto/*.protosrc/main/kotlin/*.ktsrc/test/kotlin/*.kt这是我的build.gradle文件:version'1.0-SNAPSHOT'applyplugin:'kotlin'applyplugin:'java'applyplugin:'com.google.protobuf'repositories{mavenC