We’ve been using protocol buffers, and are generating the c++ and python files with protoc, and the c# files with protobuf-csharp-port. At the moment these are done separately, the c++ and python from linux and the c# from windows. We’d like to have one script generate all of these, running in linux.
To do this I’m trying to run ProtoGen.exe with mono, but it’s not producing any output. The following command runs, but produces no cs files, and no errors.
mono ../cs/Packages/Google.ProtocolBuffers/tools/ProtoGen.exe --protoc_dir=/usr/local/bin/ ./subdir/simple_types.proto
I’ve got a feeling that I’m missing something simple.
I don’t think I’ve tried running protoc from ProtoGen.exe on Linux. I’m surprised that it doesn’t have any errors, but we can definitely look into that. (If you fancy raising an issue, that would be really helpful – or I’ll do it when I get the chance.)
For the moment, I suggest that you run protoc first, using
--descriptor_set_outto produce a binary (protobuf) version of the .proto file. That’s what ProtoGen.exe is trying to do first, and failing by the sounds of it.Once you’ve got the binary version of your message descriptor (I’d call it simple_types.pb), you can run ProtoGen.exe on that. It’s been a while since I’ve done this, but I believe you should be able to just run
… and it should magically work.
As a horrible alternative, you could try symlinking
protoc.exetoprotocin your binary directory. Fundamentally I suspect that’s what’s going wrong 🙂