[protobuf] protocol buffers lite on Windows Mobile
I'm using Visual Studio 2008 with STLPort 5.2.0 and the Windows Mobile 5 R2 SDK to compile protobuf-2.2.0. I was able to compile libprotobuf- lite.lib without much difficulty and protoc.exe has no issue compiling my proto file: option optimize_for = LITE_RUNTIME; message RCMessage { required int32 version = 1; } But, when I try to link against it in a WM5 program, I get linker errors (below). Can anybody suggest what I may be doing wrong? Thanks, PaulH 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::~basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar (void) (??1?$basic_str...@dv?$char_traits@d...@stlp_std@@V? $alloca...@d@2@@stlp_std@@q...@xz) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: __cdecl stlp_std::allocatorchar::~allocatorchar(void) (??1? $alloca...@d@stlp_std@@q...@xz) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar (char const *,class stlp_std::allocatorchar const ) (??0? $basic_str...@dv?$char_traits@d...@stlp_std@@V? $alloca...@d@2@@stlp_std@@q...@pbdabv?$allocator@d...@1@@Z) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: __cdecl stlp_std::allocatorchar::allocatorchar(void) (??0? $alloca...@d@stlp_std@@q...@xz) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: char const * __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::c_str (void)const (?c_...@?$basic_string@dv?$char_tra...@d@stlp_std@@V? $alloca...@d@2@@stlp_std@@QBAPBDXZ) already defined in stlportd_static.lib(dll_main.o) 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar (class stlp_std::allocatorchar const ) (??0?$basic_str...@dv? $char_tra...@d@stlp_std@@v?$alloca...@d@2@@stlp_std@@q...@abv? $alloca...@d@1@@Z) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: static void __cdecl stlp_std::__node_alloc::deallocate(void *,unsigned int) (?dealloc...@__node_alloc@stlp_std@@saxp...@z) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: void __cdecl stlp_std::__stl_throw_out_of_range(char const *) (? __stl_throw_out_of_ra...@stlp_std@@yax...@z) already defined in stlportd_static.lib(dll_main.o) 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: static void * __cdecl stlp_std::__node_alloc::allocate(unsigned int ) (? alloc...@__node_alloc@stlp_std@@sapax...@z) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: void __cdecl stlp_std::__stl_throw_length_error(char const *) (? __stl_throw_length_er...@stlp_std@@yax...@z) already defined in stlportd_static.lib(dll_main.o) 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: char const * __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::data (void)const (?d...@?$basic_string@dv?$char_tra...@d@stlp_std@@V? $alloca...@d@2@@stlp_std@@QBAPBDXZ) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: unsigned int __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::size (void)const (?s...@?$basic_string@dv?$char_tra...@d@stlp_std@@V? $alloca...@d@2@@stlp_std@@QBAIXZ) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: char * __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::begin (void) (?be...@?$basic_string@dv?$char_tra...@d@stlp_std@@V? $alloca...@d@2@@stlp_std@@QAAPADXZ) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: bool __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::empty (void)const (?em...@?$basic_string@dv?$char_tra...@d@stlp_std@@V? $alloca...@d@2@@stlp_std@@QBA_NXZ) already defined in remote.pb.obj 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: void __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::clear (void) (?cl...@?$basic_string@dv?$char_tra...@d@stlp_std@@V? $alloca...@d@2@@stlp_std@@QAAXXZ) already defined in remote.pb.obj 1Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Debug/ProtocolTest.exe : fatal error LNK1169: one or more multiply defined symbols found --~--~-~--~~~---~--~~ You
[protobuf] Compilation fromprotobuf on Windows CE (ARM4I)
Hello, I try to compile protobuf for Windows CE (ARM4I) and I stumbled upon a compilation error error C2059 : Syntax error : ')' in extension_set.cc. After some research i found out that the define OPTIONAL is not existent for windows ce. Can somebody help me with this define? Can someone explain me why this define is used? Is there a possible workaround? Regards, menuthaur --~--~-~--~~~---~--~~ 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: g++4.4 fix
Are you sure the problem isn't simply that you've enabled certain pedantic warnings? I strongly doubt that GCC 4.4 actually requires explicit initialization of superclasses as this would break lots and lots of code. On Fri, Oct 30, 2009 at 10:13 AM, Oleg Smolsky o...@smolsky.net wrote: Hey Kenton, I've attached a patch for protoc - it now emits code that is accepted by g++4.4/x64. I know the addition looks retarded, but g++ versions 4.4.1 and 4.4.2 just refuse to compile the generated source otherwise... Oleg. --~--~-~--~~~---~--~~ 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] Concatenation of adjacent strings in text-formated protobuf message (Java API)
Hi, Using the Java API, when attempting to parse a text-formatted protobuf message that contains adjacent strings that are meant to be concatenated, such as in the following contrived example: name:John Smith profession:mailman description: all these strings are concatenated to form a single very long description The following exception is thrown: Exception in thread main com.google.protobuf.TextFormat $ParseException: 3:5: Expected identifier. at com.google.protobuf.TextFormat$Tokenizer.parseException (TextFormat.java:698) at com.google.protobuf.TextFormat$Tokenizer.consumeIdentifier (TextFormat.java:525) at com.google.protobuf.TextFormat.mergeField(TextFormat.java: 851) at com.google.protobuf.TextFormat.merge(TextFormat.java:811) at com.google.protobuf.TextFormat.merge(TextFormat.java:757) Is this not meant to be supported? Thank you. --~--~-~--~~~---~--~~ 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: protocol buffers lite on Windows Mobile
I've found that if I don't use STLPort, it works fine. Which is unfortunate because I need STLPort for Boost to work under WinCE! Any thoughts on how to get STLPort to work nicely with Protocol Buffers? Thanks, PaulH On Oct 30, 10:45 am, PaulH paul.h...@gmail.com wrote: I'm using Visual Studio 2008 with STLPort 5.2.0 and the Windows Mobile 5 R2 SDK to compile protobuf-2.2.0. I was able to compile libprotobuf- lite.lib without much difficulty and protoc.exe has no issue compiling my proto file: option optimize_for = LITE_RUNTIME; message RCMessage { required int32 version = 1; } But, when I try to link against it in a WM5 program, I get linker errors (below). Can anybody suggest what I may be doing wrong? Thanks, PaulH 1stlportd.5.2.lib(stlportd.5.2.dll) : error LNK2005: public: __cdecl stlp_std::basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar ::~basic_stringchar,class stlp_std::char_traitschar,class stlp_std::allocatorchar (void) (??1?$basic_str...@dv?$char_traits@d...@stlp_std@@V? $alloca...@d@2@@stlp_std@@q...@xz) already defined in remote.pb.obj snip --~--~-~--~~~---~--~~ 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: Compilation fromprotobuf on Windows CE (ARM4I)
On Fri, Oct 30, 2009 at 10:36 AM, PaulH paul.h...@gmail.com wrote: OPTIONAL is already defined in windef.h. At the top of extension_set.cc, add this: #ifdef UNDER_CE #ifdef OPTIONAL #undef OPTIONAL #endif #endif Or you can just simply write: #undef OPTIONAL since it's going to be a problem on any platform if it is defined. I think you may have to put this at the top of the header file, not the .cc file. On Oct 30, 3:53 am, menuthaur menuth...@gmx.de wrote: Hello, I try to compile protobuf for Windows CE (ARM4I) and I stumbled upon a compilation error error C2059 : Syntax error : ')' in extension_set.cc. After some research i found out that the define OPTIONAL is not existent for windows ce. Can somebody help me with this define? Can someone explain me why this define is used? Is there a possible workaround? Regards, menuthaur --~--~-~--~~~---~--~~ 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: g++4.4 fix
I've applied the patch anyway -- minus the disparaging comment -- since there's no harm and other people have complained about this. Rev 238. On Fri, Oct 30, 2009 at 10:56 AM, Oleg Smolsky o...@smolsky.net wrote: Oh, man you are right. It's a combination of -Werror and -Wextra. Well, this is certainly not a protobuf issue, as it is my code that uses -Wextra. The option brings many good checks, but one of them is completely retarded. Arg!... Thanks! Oleg. On 10/30/2009 10:32 AM, Kenton Varda wrote: Are you sure the problem isn't simply that you've enabled certain pedantic warnings? I strongly doubt that GCC 4.4 actually requires explicit initialization of superclasses as this would break lots and lots of code. On Fri, Oct 30, 2009 at 10:13 AM, Oleg Smolsky o...@smolsky.net wrote: Hey Kenton, I've attached a patch for protoc - it now emits code that is accepted by g++4.4/x64. I know the addition looks retarded, but g++ versions 4.4.1 and 4.4.2 just refuse to compile the generated source otherwise... Oleg. --~--~-~--~~~---~--~~ 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] On SnowLeopard, EXC_CRASH (SIGABRT)
Hello, I have a byte array which I'd like to deserialize, it is about 3K bytes. On RHEL 5, 64 bit machine, protobuf 2.2 my deserialization works. On Leopard 10.5.7 on a macbook it also works. (for both 32 bit and 64 bit versions) Above gcc: 4.0.1 However, someone reported this crash on SnowLeopard (gcc4.2) I'm not sure why this happens. The crash appears to arise within the protobuf calls. Regards Saptarshi Process: R [34034] Path:/Applications/R64.app/Contents/MacOS/R Identifier: org.R-project.R Version: R 2.10.0 GUI 1.30 Leopard build 64-bit (5511) Code Type: X86-64 (Native) Parent Process: launchd [182] Date/Time: 2009-10-28 20:11:54.353 -0700 OS Version: Mac OS X 10.6.1 (10B504) Report Version: 6 Interval Since Last Report: 195786 sec Crashes Since Last Report: 2 Per-App Interval Since Last Report: 1676 sec Per-App Crashes Since Last Report: 1 Anonymous UUID: 0A96FBCF-6045-4A38- A8E5-619A52D23CE5 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x, 0x Crashed Thread: 0 Dispatch queue: com.apple.main-thread Application Specific Information: abort() called Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libSystem.B.dylib 0x7fff836bdff6 __kill + 10 1 libSystem.B.dylib 0x7fff8375f072 abort + 83 2 libSystem.B.dylib 0x7fff83676095 free + 128 3 libstdc++.6.dylib 0x7fff87aa71e8 std::string::reserve(unsigned long) + 90 4 libstdc++.6.dylib 0x7fff87aa742b std::string::append(char const*, unsigned long) + 127 5 libprotobuf.4.dylib 0x000116a0989c google::protobuf::io::CodedInputStream::ReadString(std::string*, int) + 236 (coded_stream.h:761) 6 Rhipe.so0x00011430909c STRING ::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) + 396 7 Rhipe.so0x0001143099d8 REXP ::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) + 2104 8 Rhipe.so0x000114309de8 REXP ::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*) + 3144 9 libprotobuf.4.dylib 0x0001169f893e google::protobuf::MessageLite::ParseFromArray(void const*, int) + 62 (message_lite.cc:104) 10 Rhipe.so0x00011430d5d3 unserializeUsingPB + 99 Saptarshi Guha | saptarshi.g...@gmail.com | http://www.stat.purdue.edu/~sguha The use of anthropomorphic terminology when dealing with computing systems is a symptom of professional immaturity. -- Edsger W. Dijkstra --~--~-~--~~~---~--~~ 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: Java: how to use protobuf to send messages quickly over sockets?
I'm a bit embarrassed :) The protobuf version of my code uses about 950MB of memory (the Java Serializable version is only using around 650MB) and I had the java - Xmx flag set too low; in reality protobuf is extremely fast compared to Java Serializable: Java Serializable: 12,000 msgs/sec Protocol Buffers (as described in my first post): 70,000 msgs/sec Protocol Buffers (CodedOutputStream, as described in Evan's post): 73,000 msgs/sec Protocol Buffers (CodedOutputStream, but no flush() after each write): 76,600 msgs/sec Thanks very much for the help, I'm very happy with the performance! Jonathan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---