[protobuf] Re: undefined reference to GzipInputStream

2011-05-19 Thread Shin
thanks, the problem has been solved.
I reinstalled the newest version of protobuf.

On 5月19日, 上午12時58分, Kenton Varda ken...@google.com wrote:
 GzipInputStream is only compiled into the library if zlib is available,
 since it depends on zlib.  On Unix you should be able to fix this by
 installing libz.so, on MSVC you may need to modify the project files a bit.







 On Wed, May 18, 2011 at 12:18 AM, Shin for.shin1...@gmail.com wrote:
  I'm learning how to use the gzip stream.
  The error msg always bother me.
  It saying:

   undefined reference to

  `google::protobuf::io::GzipInputStream::GzipInputStream(google::protobuf::i 
  o::ZeroCopyInputStream*,
  google::protobuf::io::GzipInputStream::Format, int)

  It seems only found the header file but no dynamic lib.
  Does it mean I didn't install the lib correctly?
  I have installed the newest zlib version and re-installed the
  protobuf, but the problem is still existing.

  Thanks for ur 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.

-- 
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: Proto file generation from Descriptors in Java (DebugString)

2011-05-19 Thread Ben Wright
previous thread:
http://groups.google.com/group/protobuf/browse_thread/thread/4bf8bca8c88e82ba/dbaa2803984f3934?lnk=gstq=debugString()#dbaa2803984f3934

On May 18, 6:05 pm, Ben Wright compuware...@gmail.com wrote:
 There has been some back and forth previously about java language
 support for generating a proto file from a Descriptor.

 The suggested implementation was to either wrap or port the
 DebugString capability from decriptor.cc

 I recently ported the DebugString capability to java - it's a bit
 rough as it's a by-hand port from the c code, but I also fixed some
 bugs in the way the file was generated.  For instance, extended types
 were not output with correct parenthesis around them and options that
 were messages did not have appropriate {} around them - these could
 easily be due to differences in the C and Java code though.  I'd be
 glad to elaborate further for anyone interested, but for now I'm
 simply providing the ported code as static functions in a java file.
 Notably, if integrated with the java library these functions should
 probably not be in a static file, they should be included with their
 appropriate descriptor types.

 If it is decided that this functionality should be part of the Java
 library, I would be willing to do the leg work and get these functions
 in better shape and update the appropriate files.  I can pass them
 along in an issue report for a committer to check in.

 Notably, if you're looking for someone to work on the Java library /
 outstanding issues at all, I'm looking for something to do in my
 mythical free time.  I could help with c too, but I'm much stronger in
 Java.

 PS: This is all based on release 2.4.1

 === DebugString.java ===

 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.Stack;

 import com.google.protobuf.Descriptors.Descriptor;
 import com.google.protobuf.Descriptors.EnumDescriptor;
 import com.google.protobuf.Descriptors.EnumValueDescriptor;
 import com.google.protobuf.Descriptors.FieldDescriptor;
 import com.google.protobuf.Descriptors.FileDescriptor;
 import com.google.protobuf.Descriptors.MethodDescriptor;
 import com.google.protobuf.Descriptors.ServiceDescriptor;
 import com.google.protobuf.Message;
 import com.google.protobuf.TextFormat;

 /**
  * This class provides .proto file generation from Java Proto
 Descriptors.
  * brDerived from descriptor.cc in Protobuf 2.4.1
  * br
  * brbOriginal Copyright Notice from descriptor.cc:/b
  * br
  * br Protocol Buffers - Google's data interchange format
  * br Copyright 2008 Google Inc.  All rights reserved.
  * brhttp://code.google.com/p/protobuf/
  * br
  * br Redistribution and use in source and binary forms, with or
 without
  * br modification, are permitted provided that the following
 conditions are
  * br met:
  * br
  * br     * Redistributions of source code must retain the above
 copyright
  * br notice, this list of conditions and the following disclaimer.
  * br     * Redistributions in binary form must reproduce the above
  * br copyright notice, this list of conditions and the following
 disclaimer
  * br in the documentation and/or other materials provided with the
  * br distribution.
  * br     * Neither the name of Google Inc. nor the names of its
  * br contributors may be used to endorse or promote products
 derived from
  * br this software without specific prior written permission.
  * br
  * br THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 CONTRIBUTORS
  * br AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
 NOT
  * br LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 FITNESS FOR
  * br A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 COPYRIGHT
  * br OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 INCIDENTAL,
  * br SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 NOT
  * br LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 OF USE,
  * br DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 ON ANY
  * br THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
 TORT
  * br (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
 THE USE
  * br OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 DAMAGE.
  * br
  * br Author: ken...@google.com (Kenton Varda)
  * br  Based on original Protocol Buffers design by
  * br  Sanjay Ghemawat, Jeff Dean, and others.
  *
  * @author Benjamin Wright (compuware...@gmail.com)
  */
 public class DebugString {

         private static void SubstituteAndAppend(StringBuilder contents,
 String replace, Object... objects ) {
                 for(int i = 0; i  objects.length; i++) {
                         final String old = $+i;
                         replace = replace.replace(old, 
 String.valueOf(objects[i]));
                 }
                 contents.append(replace);
         }

         

[protobuf] Re: RPC layer over protocol buffers

2011-05-19 Thread joshrotenb...@gmail.com
There are a few options here: 
http://code.google.com/p/protobuf/wiki/ThirdPartyAddOns#RPC_Implementations

Another option I'm liking lately is using ZeroMQ with Protocol
Buffers: http://www.zeromq.org/community

I've got some example code using PB/0MQ here: 
https://github.com/joshrotenberg/zmqpbexample

Hope that helps.

Josh

On May 18, 12:06 pm, Anurag anurag.guj...@gmail.com wrote:
 Hi All,
           Does anyone knows any good implementation of rpc in c++
 which i can use with protocol buffers
 to take care of networking.
 Thanks
 Anurag

-- 
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.