[protobuf] Compiling protocol buffers on QNX 6.4

2012-03-06 Thread C_Coder
Hi,
I have been trying to get protobuf to compile for a QNX6.4 system
(already got it working fine on Linux). At first it had trouble
finding libstdc++ in the auto-generated path but once I fixed it to
take the library that ships with QNX6.4 there are still unresolved
symbols related to that library. Has protobuf been successfully used
on QNX? Any idea what I could be missing?

Thanks,
Vineet

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Package Mandatory ?

2012-03-06 Thread Julien PONNOU
Hello,

When I include several couples of .h/.cc in my project, I got the
following errors during the compilation:

error C2086: 'google::protobuf::ProtobufOnceType `anonymous-
namespace'::protobuf_AssignDescriptors_once_' : redefinition
see declaration of '`anonymous-
namespace'::protobuf_AssignDescriptors_once_'
error C2084: function 'void `anonymous-
namespace'::protobuf_AssignDescriptorsOnce(void)' already has a body
see previous definition of 'protobuf_AssignDescriptorsOnce'
error C2084: function 'void `anonymous-
namespace'::protobuf_RegisterTypes(const std::string )' already has a
body
see previous definition of 'protobuf_RegisterTypes'

Basically, it's telling me these functions are declared in all couples
of .h/.cc. Using a different package for each couple of .h/.cc
corrects the problem, but I don't want to do so. Without using any
package, can someone explain me how to solve this error ?

Best regards,

Julien.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Unable to Install

2012-03-06 Thread Gaurav Agarwal
Hi
I am new to Protocol Buffers and trying to install it on Intel core i3
with windows 7 64 bit. I copied protocol buffers  files to

C:\Users\Program Files\protobuf-2.4.1 and intalled Cygwin and cd to
protocol buffers directory

/cygdrive/c/Program Files/protobuf-2.4.1

$ ./configure

and result is

checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... i686-pc-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/cygdrive/c/Program Files/protobuf-2.4.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

and when I typed

gaurav@gaurav-VAIO /cygdrive/c/Program Files/protobuf-2.4.1
$ make
-bash: make: command not found

I new to Linux and Protocol Buffers. I will appreciate if some can
help and send complete instructions for installs for use with Java.

Thanks
Gaurav Agarwal





-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: I am new in Protocol Buffers

2012-03-06 Thread Jan Bezget
When I first started using protobuf in my application, I relied solely on 
http://code.google.com/apis/protocolbuffers/docs/overview.html. It's a 
great resource of documentation and provides helpful examples.

There's a cool plugin for Eclipse! You can get it at 
http://code.google.com/p/protobuf-dt/wiki/Installing.

Protoc is the protocol buffer compiler. Once you've defined your protocol 
in the .proto file, you must compile it to a language of your choice 
(Python, C++, Java) so you can begin using it in your project.

On Monday, February 13, 2012 2:38:43 PM UTC+1, Lyrya wrote:

 Hi All, 

 I don't know how to add protocol buffers library for eclipse. 
 and what is the use of protoc? 
 Is there any tutorial that can help me understanding about protocol 
 buffers? 

 Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/6w52mYXzW3cJ.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] re: protobuf-net 480 for .net 4 - objects in a IList I serialize have all members serialized to 0

2012-03-06 Thread costa
Have you seen this?

The list is an IListTestClass where TestClass has the ProtoContract
attribute and all its members have the ProtoMember attribute.

When I serialize it the bin file contains only 0A 00 bytes. When I
deserialize it all objects have the members set to 0.

What am I doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] proto buff crash

2012-03-06 Thread jjshang
hi,

we use proto buff for our c-s application. We find there seem to be no
problems if server proto's optional, repeated field do not exist in
client's proto, so our server and client use different proto defines,
and it works well.

But recently there happens some crash in client proto buff code when
server send a lot of undefined complicate nested optional/repeated
field to client.

app.exe!
std::basic_stringchar,std::char_traitschar,std::allocatorchar
::`scalar deleting destructor'()  + 0x9 字节 C++
app.exe!google::protobuf::UnknownField::Delete()  行177 + 0x1f 字节
C++
app.exe!google::protobuf::UnknownFieldSet::ClearFallback()  行58 C++
app.exe!google::protobuf::UnknownFieldSet::~UnknownFieldSet()  行51  
C+
+
app.exe!MyProtoInner::~MyProtoInner()  行15119 + 0x4a 字节 C++
app.exe!MyProtoInner::`scalar deleting destructor'()  + 0x8 字节  C++
app.exe!
google::protobuf::internal::RepeatedPtrFieldBase::Destroygoogle::protobuf::RepeatedPtrFieldMyProtoInner::TypeHandler()
行622 + 0x11 字节  C++
app.exe!MyProto::~MyProto()  行16864 + 0x10 字节   C++

It seems happen in memory release procedure, and if we bring the 5
lines proto buff relative code to a gtest, it crash in same place
steady. Can anybody help?

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: protobuf_AssignDescriptors_once_ redefined?

2012-03-06 Thread Julien PONNOU
Hello,

I'm getting the exact same issue and I'd like to know how did you resolve 
it ?

Julien.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/jbVLBPO0J-0J.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Support for xml, json, protobuf and Java Object Model retention

2012-03-06 Thread Anthony
Hi,

 I'm trying a similar thing with trying to support Protobuffer for
XINS (an open source web framework that also support different
protocols).  What I'd like to do is to parse a message and generate
the output without the need to compile a .proto file. I'm looking at
DynamicMessage but I can't find out how to parse a message or create a
DynamicMessage.

 Please Google use the -use option of the javadoc to see how to create
all the final classes that don't have constructors.

Regards,
Anthony
On 23 fév, 18:40, Meghana meghana.vishwan...@gmail.com wrote:
 Hi,

 I am trying to implement protobuf for a REST Jersey application.
 Currently, we use XML and JSON serialization provided by the Jersey
 framework. So, the only thing we need to do is set the correct mime-
 type.

 As far as my knowledge goes, the only way to be able to accomodate all
 three types would be to write MessageBodyReader/Writer that translate
 protobuf to XML and JSON and vice versa. This seems redundant to me
 since the Jersey framework already does XML and JSON serialization
 automatically. Is there a better way of achieving this?

 Also, we already have an object model defined in Java and would like
 to continue using the same model in the rest of the application. Is it
 possible to retain this model and not use the auto-generated entities
 for passing objects back and forth from the application?

 Thanks,
 Meghana.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] How to read continuous stream of messages from TCP

2012-03-06 Thread waynix
Hello All;

New to protobuf and did some limited search for my question. So my
apology if this has already been talked about.

I naively thought that ParseFromFileDescriptor/ParseFromIstream would
block on an TCP socket and return when a valid message is received.
Read some old posts from 2010 and realized it's not that easy due to
mesages not being self-delimiting.  And the suggestion from Jason
Hsueh was as follows:

One approach to writing multiple messages to the same stream is to use
a
length-delimited format: write the size of the message, then serialize
the
message itself. On the receiver side, you would set up a
FileInputStream,
and wrap a CodedInputStream around that. You can read the size of the
messages from the stream and then use PushLimit and PopLimit to
control how
much data is read.


My quesions are:

1. Is this still the way to do it? Seems quite cumbersome (to lazy
me ;-).  Is there  a wrapper built in to do this?
2. If I understand Jason's suggestion riht, the length is really not
part of the message, and the sender has to explcitly set it, instead
of having protobuf encode it in. Which means a generic third party
sender using my .proto file would not be sufficient.  Plus how would
they know the length before encoding the message proper? Filling it in
after the fact would change the length again? or I am totally
missing it.

3. A related quesiton is in general do I have to manage reading of the
socket, or for that matter any istream, and spoon feed the protobuf
parser until it says OK, that's a whole message?

Thanks a lot.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 256 in protobuf: Error Converting Message to array of Bytes (When negative Enum) - Java

2012-03-06 Thread protobuf

Updates:
Labels: FixedIn-2.4.1

Comment #9 on issue 256 by jas...@google.com: Error Converting Message to  
array of Bytes (When negative Enum) - Java

http://code.google.com/p/protobuf/issues/detail?id=256

2.4.1 should have contained this fix. Can you post a reproduction? If your  
serialization does not have a negative enum value, then please open a  
separate issue - the exception can occur generally when the ByteSize  
computation does not match the size of data written by the serializer.


There is no message level interface, but you can just create the  
CodedOutputStream around your OutputStream directly:
http://code.google.com/apis/protocolbuffers/docs/reference/java/com/google/protobuf/CodedOutputStream.html#newInstance(java.io.OutputStream,  
int)
However, I think you should only be getting the OutOfSpaceException if  
you're using the byte[] version of the methods, in which case the data is  
written directly to the array. You need to make sure that the byte array  
you provide is sufficiently large.



--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] How to read continuous stream of messages from TCP

2012-03-06 Thread Evan Jones
On Feb 27, 2012, at 17:27 , waynix wrote:
 1. Is this still the way to do it? Seems quite cumbersome (to lazy me ;-).  
 Is there  a wrapper built in to do this?

Yes. Sadly there is no wrapper included in the library.


 2. If I understand Jason's suggestion riht, the length is really not
 part of the message, and the sender has to explcitly set it, instead
 of having protobuf encode it in. Which means a generic third party
 sender using my .proto file would not be sufficient.  Plus how would
 they know the length before encoding the message proper? Filling it in
 after the fact would change the length again? or I am totally
 missing it.

As long as both sides encode the length in the same way , just having the right 
.proto will do the trick. 


 3. A related quesiton is in general do I have to manage reading of the
 socket, or for that matter any istream, and spoon feed the protobuf
 parser until it says OK, that's a whole message?

Basically yes. There is a sketch of some example code here:

https://groups.google.com/forum/?fromgroups#!searchin/protobuf/sequence/protobuf/pLwqN4jTVvY/60PBaEadW5IJ


Good luck,

Evan

--
http://evanjones.ca/

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 256 in protobuf: Error Converting Message to array of Bytes (When negative Enum) - Java

2012-03-06 Thread protobuf


Comment #10 on issue 256 by jhan...@gmail.com: Error Converting Message to  
array of Bytes (When negative Enum) - Java

http://code.google.com/p/protobuf/issues/detail?id=256

sorry, yeah, I'm getting this same exception but simply because the  
underlying CodedOutputStream default buffer size is not large enough.


We are using writeDelimitedTo() and not write(), and unfortunately, while  
write() accepts a CodedOutputStream, writeDelimitedTo() does not, so I'm  
unable to figure out how to alter its buffer size.


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Issue 256 in protobuf: Error Converting Message to array of Bytes (When negative Enum) - Java

2012-03-06 Thread protobuf


Comment #11 on issue 256 by jas...@google.com: Error Converting Message to  
array of Bytes (When negative Enum) - Java

http://code.google.com/p/protobuf/issues/detail?id=256

The internal buffer for CodedOutputStream should just be a performance  
optimization; it's an internal buffer so that CodedOutputStream doesn't  
make a bunch of small writes to an OutputStream, which might be slow.


I still don't see how it is possible to get an OutOfSpaceException if you  
are using writeDelimitedTo; an OutputStream must be provided for this API,  
but the OutOfSpaceException is only ever thrown if the CodedOutputStream  
has a null OutputStream:  
http://code.google.com/p/protobuf/source/browse/trunk/java/src/main/java/com/google/protobuf/CodedOutputStream.java#795


Can you start a new thread in the protobuf mailing list, with a small,  
self-contained reproduction of your problem?


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: I am new in Protocol Buffers

2012-03-06 Thread Lyrya
Hi,

https://lh3.googleusercontent.com/-AuNYI2iBIzI/T1cRNVsWZxI/ACk/HANdbjbuyAU/s1600/Error%2520Problem.pngYeah,
 
thanks..
I already followed all the instructions there, but there occurred one 
problem like this.
I captured this problem, maybe, you can help me to solve it.

thanks,

Robert.















On Thursday, March 1, 2012 9:56:26 PM UTC+1, Jan Bezget wrote:

 When I first started using protobuf in my application, I relied solely on 
 http://code.google.com/apis/protocolbuffers/docs/overview.html. It's a 
 great resource of documentation and provides helpful examples.

 There's a cool plugin for Eclipse! You can get it at 
 http://code.google.com/p/protobuf-dt/wiki/Installing.

 Protoc is the protocol buffer compiler. Once you've defined your protocol 
 in the .proto file, you must compile it to a language of your choice 
 (Python, C++, Java) so you can begin using it in your project.

 On Monday, February 13, 2012 2:38:43 PM UTC+1, Lyrya wrote:

 Hi All, 

 I don't know how to add protocol buffers library for eclipse. 
 and what is the use of protoc? 
 Is there any tutorial that can help me understanding about protocol 
 buffers? 

 Thank you.



-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/lUtSssIn6cQJ.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.