[英]How to build protobuf-csharp-port on Mono under Windows
I've read the instruction for building protobuf-csharp-port using Mono
under Linux/Unix
system.我已经阅读了在
Linux/Unix
系统下使用Mono
构建protobuf-csharp-port的说明。 I still can't get it work and eventually I'll open a thread to ask why, but that's not the question of this post.我仍然无法让它工作,最终我会打开一个线程来询问原因,但这不是这篇文章的问题。
I'm using Windows
to develop and I have successfully built protobuf-csharp-port using VS2010
.我正在使用
Windows
进行开发,并且已经使用VS2010
成功构建了 protobuf-csharp-port 。 The fact is that I need to use the generated C# classes from inside Unity3D
, which requires to use Mono.事实是,我需要使用
Unity3D
内部生成的 C# 类,这需要使用 Mono。
I have Mono 2.8 installed on my machine.我的机器上安装了Mono 2.8 。
The question is:问题是:
is possible to build protobuf-csharp-port
in Windows using MonoDevelop
?可以使用
MonoDevelop
在 Windows 中构建protobuf-csharp-port
吗? I tried to simply import the VS2010 solution and compile it using Mono but it doesn't works.我试图简单地导入 VS2010 解决方案并使用 Mono 编译它,但它不起作用。
How can I do it?我该怎么做?
EDIT编辑
While trying to simply compile VS solution using MonoDevelop I got several errors.在尝试使用 MonoDevelop 简单地编译 VS 解决方案时,我遇到了几个错误。 The first is in the following line of
FieldMappingAttribute.cs
:第一个位于
FieldMappingAttribute.cs
的以下行中:
public MappedType MappedType { get; private set; }
The error is the following:错误如下:
FieldMappingAttribute.cs(40,40): Error CS0501: 'Google.ProtocolBuffers.Descriptors.FieldMappingAttribute.MappedType.get' must declare a body because it is not marked abstract or extern (CS0501) (ProtocolBuffers)
FieldMappingAttribute.cs(40,40): 错误 CS0501: 'Google.ProtocolBuffers.Descriptors.FieldMappingAttribute.MappedType.get' 必须声明一个主体,因为它没有被标记为抽象或外部 (CS0501) (ProtocolBuffers)
You shouldn't need to build the main protobuf-csharp-port project yourself... or if you do, you should be able to do that very rarely.您不需要自己构建主要的 protobuf-csharp-port 项目……或者如果您这样做,您应该很少这样做。
You don't need to rebuild protobuf-csharp-port just to build the generated C# classes.您不需要为了构建生成的 C# 类而重建 protobuf-csharp-port。 Just add a reference to Google.ProtocolBuffers.dll, and you should be fine.
只需添加对 Google.ProtocolBuffers.dll 的引用,就可以了。
That said, I haven't tested it on Mono for a while.也就是说,我已经有一段时间没有在 Mono 上测试过它了。 It doesn't do anything desperately tricky, but you should definitely test thoroughly.
它不会做任何非常棘手的事情,但你绝对应该彻底测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.