Open GoogleCodeExporter opened 9 years ago
Original comment by marc.gravell
on 2 Feb 2011 at 8:15
Is there any more assistance I can provide with troubleshooting this? I'd
submit a patch if I had an idea of which direction to go with it...
Original comment by whitel...@gmail.com
on 15 Feb 2011 at 3:23
The problem is that it tries to execute the embedded "protoc" (unmanaged
executable).
That is available for *nix, so it *should* just be a case of swapping that out.
Incidentally, you can use protoc *in isolation* to compile to binary, and then
give this to protogen, in which case it won't need to run protoc.
Original comment by marc.gravell
on 15 Feb 2011 at 3:42
I had tried just swapping it out in my second attempt above, but it ended up
getting a null reference exception when I ran it.
Could you provide an example of using protoc separately with protogen? I hadn't
seen a way to do that, but it'd be a great workaround until protogen gets fixed
for Mono.
Original comment by whitel...@gmail.com
on 15 Feb 2011 at 4:31
[deleted comment]
Ok, I found a way to run protoc and protogen together... thought I had found a
way to run them without a temporary file, but it appears that neither of them
recognizes '-' as stdin/stdout, so piping protoc's output to protogen doesn't
work.
Here's the workaround I'm using now:
protoc -I. kCL.proto -okCL.bin
protogen -i:kCL.bin -o:kCL.cs
Original comment by whitel...@gmail.com
on 15 Feb 2011 at 4:38
That is a nice workaround. I'll see of I can think of an elegant way of doig
this more generally without needing to embed both binaries
Original comment by marc.gravell
on 15 Feb 2011 at 5:44
Also - I'll check the stdin issue; iirc I support stdout - kinda surprised I
don't handle stdin
Original comment by marc.gravell
on 15 Feb 2011 at 5:46
You may want to look at protoc's new plugin support; see
http://code.google.com/apis/protocolbuffers/docs/reference/other.html and
http://www.mail-archive.com/protobuf@googlegroups.com/msg03764.html .
Original comment by whitel...@gmail.com
on 15 Feb 2011 at 6:00
Also, I wrote up a quick, generic Makefile using that workaround; I've attached
it in case anyone else finds it useful in the meantime. If you'd like to use
it, make sure to at least adjust the path to protogen.exe at the top of the
file.
Original comment by whitel...@gmail.com
on 15 Feb 2011 at 6:27
Attachments:
I was able to fix the issue on Ubuntu by just adding a symbolic link:
ubuntu@ubuntu-VirtualBox:/usr/bin$ sudo ln -s protoc protoc.exe
That allowed 'mono ProtoGen.exe' to find the unmanaged executable even though
it's using the .exe extension.
Original comment by mark.der...@gmail.com
on 15 Mar 2014 at 9:17
Sorry-- I forgot to say that I had to delete the Windows binary from the
Protobuf-CSharp-Port/tools directory so that it would not be found first.
Original comment by mark.der...@gmail.com
on 15 Mar 2014 at 9:20
Original issue reported on code.google.com by
whitel...@gmail.com
on 1 Dec 2010 at 9:04