Discussion:
How to use protoc on Windows?
antiso
2008-08-28 17:26:58 UTC
Permalink
When I try to compile .proto file into dir with absolute path it
always fails. I use following command :
protoc --java_out=C:\work Some.proto
protoc --java_out=C:/work Some.proto
protoc --java_out=file://C:/work Some.proto
protoc --java_out=file:///C:/work Some.proto

How to specify absolute path for output?

Another issue is with specifying path to .proto file in windows format
using "\" as separator. It generates uncompilable code because java
compiler consider "\" as escape char. Example:
throw new RuntimeException(
"Failed to parse protocol buffer descriptor for " +
"\"proto\Some.proto\".", e); // <--- invalid escape char error
here

I use ProtocolBuffers 2.0beta built on Windows using Cygwin gcc.

Regards,
Vladimir


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to protobuf+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---
Kenton Varda
2008-08-29 17:12:32 UTC
Permalink
This is a bug in protoc 2.0.0 which will be fixed in 2.0.1... if only I
could get this ridiculous Maven issue sorted out and release the thing. :/
The problem is that protoc interprets everything before the colon as a
generator parameter, which doesn't work when using an absolute path on
Windows. As a work-around, if the working directory is on the same drive as
the target, then you can omit the drive letter, e.g.:

protoc --java_out=\foo\bar
Post by antiso
When I try to compile .proto file into dir with absolute path it
protoc --java_out=C:\work Some.proto
protoc --java_out=C:/work Some.proto
protoc --java_out=file://C:/work Some.proto
protoc --java_out=file:///C:/work Some.proto
How to specify absolute path for output?
Another issue is with specifying path to .proto file in windows format
using "\" as separator. It generates uncompilable code because java
throw new RuntimeException(
"Failed to parse protocol buffer descriptor for " +
"\"proto\Some.proto\".", e); // <--- invalid escape char error
here
I use ProtocolBuffers 2.0beta built on Windows using Cygwin gcc.
Regards,
Vladimir
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to protobuf+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Continue reading on narkive:
Loading...