[protobuf] 65k string limit in MS Visual C++ 2005
Hi! I am having a problem when compiling my libraries which use protobuf generated sources when I'm using the Visual C++ 2005 Professional edition. I am using the version 2.3.0 of Protocol Buffers. I have described a custom string EnumValueOptions extension as follows: extend google.protobuf.EnumValueOptions { optional string message = 5; } Then, I use this string option in multiple enumeration values in single enumeration proto, somewhat like this: enum ExampleEnum { ENUMERATION_OPTION = 1 [(message) = Enumeration option 1]; ENUMERATION_OPTION = 2 [(message) = Enumeration option 2]; ENUMERATION_OPTION = 3 [(message) = Enumeration option 3]; ENUMERATION_OPTION = 4 [(message) = Enumeration option 4]; } There are a lot more of these in the real implementation (maybe hundreds and the messages are longer). When I compile this with Visual Studio 2005 Pro I get: fatal error C1091: compiler limit: string exceeds 65535 bytes in length This comes from the protoc generated file (i.e. exampleenum.pb.cc) I have tried to compile this test project also in Linux environment and with Visual C++ 2008 Express edition and the problem does not reproduce. I guess that the question is should the Protocol Buffers work when using Visual Studio 2005? I can send you example project files if necessary. Thanks for reply in advance! -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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] Tutorial example make failure
Hi, I'm new to both protocol buffer and to linux system, so excuse me for simple questions. :) I try to make in the example directory. I got the following errors: ./protobuf-2.3.0/examples$ make pkg-config --cflags protobuf # fails if protobuf is not installed -pthread -I/usr/local/include c++ add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config -- cflags --libs protobuf` In file included from add_person.cc:6: addressbook.pb.h:9:42: error: google/protobuf/stubs/common.h: No such file or directory addressbook.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is addressbook.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update addressbook.pb.h:14:2: error: #error your headers. addressbook.pb.h:22:52: error: google/protobuf/ generated_message_util.h: No such file or directory ..(many more) My questions are: 1. Why it tells me that protobuf is not installed? 2. It keeps failing in finding google/protobuf/ files. Why does this happen? Thanks a lot Zhang Bo -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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 std::basic_string?
To be honest, I didn't get as far as reflection because it didn't show up immediately as a compile error after I changed the underlying basic_string type in the messages. But as far as reflection is concerned, the only difference between my string and std::string is the allocator, so at least for now I don't mind generalizing the reflection interface to use basic_string for strings and leaving it up to the caller to make sure they cast to the correct underlying type -- whether the generated message uses my string or ::std::string is a command-line option, so the unit tests should remain operational. However I'm open to other approaches to getting around this issue, that doesn't involve refactoring so much 3rd party (at least from my point of view) code. On Apr 5, 10:04 pm, Kenton Varda ken...@google.com wrote: Unlikely. I don't know how you'd implement GeneratedMessageReflection such that it can deal with user-specified instances of basic_string. On Mon, Apr 5, 2010 at 5:15 PM, skyork sky...@gmail.com wrote: I was wondering if there was any plans to support std::basic_string, as opposed to std::string? The reason I ask is because our code base uses a custom allocator for strings and hence our own string type (i.e. typedef std::basic_string... MyString), and the generated protocol buffer code is hard-coded against ::std::string. Even when I changed the outputted string type, a lot of the library I/O still only accepted std::string. It took a few more hours of compiler/library modifications to get that fixed up, and now everything seems to compile and run correctly, however all my delicate changes will be stomped in the next version release... -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email toproto...@googlegroups.com. To unsubscribe from this group, send email toprotobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@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 proto...@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] Tutorial example make failure
Hi, You need to read and follow the instruction from the DIR/README.txt (DIR is where your protobuf-x.x.x resding) file to configure/compile/check/install the package before you can use it (That for the C++ portion). For the Java portion, you need to read and follow the instruction in the DIRjava/README.txt to build the library, after that, install your *.jar file according to the JAVA standard to use it. Hope this would help, Steven On Tue, Apr 6, 2010 at 2:19 AM, Bo Zhang zhan...@google.com wrote: Hi, I'm new to both protocol buffer and to linux system, so excuse me for simple questions. :) I try to make in the example directory. I got the following errors: ./protobuf-2.3.0/examples$ make pkg-config --cflags protobuf # fails if protobuf is not installed -pthread -I/usr/local/include c++ add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config -- cflags --libs protobuf` In file included from add_person.cc:6: addressbook.pb.h:9:42: error: google/protobuf/stubs/common.h: No such file or directory addressbook.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is addressbook.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update addressbook.pb.h:14:2: error: #error your headers. addressbook.pb.h:22:52: error: google/protobuf/ generated_message_util.h: No such file or directory ..(many more) My questions are: 1. Why it tells me that protobuf is not installed? 2. It keeps failing in finding google/protobuf/ files. Why does this happen? Thanks a lot Zhang Bo -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@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 proto...@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] Re: Support for std::basic_string?
On Tue, Apr 6, 2010 at 1:41 AM, skyork sky...@gmail.com wrote: To be honest, I didn't get as far as reflection because it didn't show up immediately as a compile error after I changed the underlying basic_string type in the messages. But as far as reflection is concerned, the only difference between my string and std::string is the allocator, so at least for now I don't mind generalizing the reflection interface to use basic_string for strings and leaving it up to the caller to make sure they cast to the correct underlying type -- whether the generated message uses my string or ::std::string is a command-line option, so the unit tests should remain operational. No, leaving it up to the caller to cast doesn't work. The reflection object itself needs to know how to copy and clear the value, and anyway the whole point of reflection is to allow you to write generic code that doesn't know on what type it is operating. However I'm open to other approaches to getting around this issue, that doesn't involve refactoring so much 3rd party (at least from my point of view) code. Maybe just define some helpers? my_string std2mine(std::string); std::string mine2std(my_string); On Apr 5, 10:04 pm, Kenton Varda ken...@google.com wrote: Unlikely. I don't know how you'd implement GeneratedMessageReflection such that it can deal with user-specified instances of basic_string. On Mon, Apr 5, 2010 at 5:15 PM, skyork sky...@gmail.com wrote: I was wondering if there was any plans to support std::basic_string, as opposed to std::string? The reason I ask is because our code base uses a custom allocator for strings and hence our own string type (i.e. typedef std::basic_string... MyString), and the generated protocol buffer code is hard-coded against ::std::string. Even when I changed the outputted string type, a lot of the library I/O still only accepted std::string. It took a few more hours of compiler/library modifications to get that fixed up, and now everything seems to compile and run correctly, however all my delicate changes will be stomped in the next version release... -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email toproto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com protobuf%2bunsubscr...@googlegroups.comprotobuf%252bunsubscr...@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 proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@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 proto...@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] Issue 177 in protobuf: undefined symbol in shared lib on Ubuntu 10.04
Status: New Owner: ken...@google.com Labels: Type-Defect Priority-Medium New issue 177 by othy74: undefined symbol in shared lib on Ubuntu 10.04 http://code.google.com/p/protobuf/issues/detail?id=177 What steps will reproduce the problem? 1. I use protoc (--cpp_out=) then build my simple cpp shared lib 2. At runtime: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameEv What version of the product are you using? On what operating system? Default protobuf (2.2.0 I think) on Ubuntu 10.04 One person was able to fix this same issue on opensuse it seems: http://forum.compiz.org/viewtopic.php?f=86t=12257 There is no libprotobuf.so.4 in my /usr/lib/. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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] Protocol buffers and CentOS
Hello, I have installed python (2.6.5) and GPB on CentOS (it's a VM not sure if that's relevant) but am not able to run. In it's simplest version I do: python -c import google.protobuf and get: Traceback (most recent call last): File string, line 1, in module ImportError: No module named google.protobuf I feel that either the gpb install did not work or I need to set an env variable to point to some libraries. thanks in advance, Eric -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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] 65k string limit in MS Visual C++ 2005
This sounds like a C++ version of the Java issue fixed with r189http://code.google.com/p/protobuf/source/detail?r=189: the encoded descriptor data in the generated file exceeded the Java string literal limit. This large descriptor was previously built in C++ but was removed from the test suite in a later revision. Kenton, do you recall if you ever ran the test with VC++2005? Just wondering if it only shows up in certain environments/settings. On Tue, Apr 6, 2010 at 12:13 AM, Iiro iiro.hiet...@gmail.com wrote: Hi! I am having a problem when compiling my libraries which use protobuf generated sources when I'm using the Visual C++ 2005 Professional edition. I am using the version 2.3.0 of Protocol Buffers. I have described a custom string EnumValueOptions extension as follows: extend google.protobuf.EnumValueOptions { optional string message = 5; } Then, I use this string option in multiple enumeration values in single enumeration proto, somewhat like this: enum ExampleEnum { ENUMERATION_OPTION = 1 [(message) = Enumeration option 1]; ENUMERATION_OPTION = 2 [(message) = Enumeration option 2]; ENUMERATION_OPTION = 3 [(message) = Enumeration option 3]; ENUMERATION_OPTION = 4 [(message) = Enumeration option 4]; } There are a lot more of these in the real implementation (maybe hundreds and the messages are longer). When I compile this with Visual Studio 2005 Pro I get: fatal error C1091: compiler limit: string exceeds 65535 bytes in length This comes from the protoc generated file (i.e. exampleenum.pb.cc) I have tried to compile this test project also in Linux environment and with Visual C++ 2008 Express edition and the problem does not reproduce. I guess that the question is should the Protocol Buffers work when using Visual Studio 2005? I can send you example project files if necessary. Thanks for reply in advance! -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@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 proto...@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 177 in protobuf: undefined symbol in shared lib on Ubuntu 10.04
Comment #1 on issue 177 by jas...@google.com: undefined symbol in shared lib on Ubuntu 10.04 http://code.google.com/p/protobuf/issues/detail?id=177 It sounds like you aren't linking against libprotobuf when compiling the generated code from your protoc command. Have you followed the instructions in the README.txt? http://code.google.com/p/protobuf/source/browse/trunk/README.txt -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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] Protocol buffers and CentOS
How did you install the python protobuf library, and what was the output? On Tue, Apr 6, 2010 at 11:15 AM, Eric yangcoo...@gmail.com wrote: Hello, I have installed python (2.6.5) and GPB on CentOS (it's a VM not sure if that's relevant) but am not able to run. In it's simplest version I do: python -c import google.protobuf and get: Traceback (most recent call last): File string, line 1, in module ImportError: No module named google.protobuf I feel that either the gpb install did not work or I need to set an env variable to point to some libraries. thanks in advance, Eric -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@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 proto...@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 177 in protobuf: undefined symbol in shared lib on Ubuntu 10.04
Comment #2 on issue 177 by othy74: undefined symbol in shared lib on Ubuntu 10.04 http://code.google.com/p/protobuf/issues/detail?id=177 I was linking against libprotobuf-lite. Linking libprotobuf does indeed fix the runtime issue. Thanks! But now it's huge. My binary used to be 23 KB. After including the generated pb.cc it went to 100 KB. When linking libprotobuf-lite: 352 KB. And with the full libprotobuf: 4458 KB. And my proto source file is only like 500 bytes. Is this expected? Are you advising the installation of protobuf from source, rather than using the default system packages? -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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 177 in protobuf: undefined symbol in shared lib on Ubuntu 10.04
Comment #3 on issue 177 by jas...@google.com: undefined symbol in shared lib on Ubuntu 10.04 http://code.google.com/p/protobuf/issues/detail?id=177 If you want to use the lite runtime, you need to make sure that your .proto file includes option optimize_for = LITE_RUNTIME; Otherwise, the generated code will make use of features that are not in the lite library (producing errors like the one you saw about a missing symbol) I don't recall the exact sizes of the libraries but that sounds about right. The full library is about 10x larger than the lite one. Using system packages should be fine. (although I don't know anything about these - I believe the packages are maintained by third parties and might not be kept up to date) -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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: Tutorial example make failure
Hi guys, here I come again with errors I can't figure out. Basically I copied the code for writing a message from tutorial and pasted it into write.cc under directory examples. write.cc is supposed to invoke addressbook When I try to compile write.cc, I got the following: protobuf-2.3.0/examples$ c++ write.cc `pkg-config --cflags --libs protobuf` /tmp/cc62Lqqa.o: In function `main': write.cc:(.text+0x45c): undefined reference to `tutorial::AddressBook::AddressBook()' write.cc:(.text+0x673): undefined reference to `tutorial::AddressBook::~AddressBook()' write.cc:(.text+0x692): undefined reference to `tutorial::AddressBook::~AddressBook()' /tmp/cc62Lqqa.o: In function `google::protobuf::internal::GenericTypeHandlertutorial::Person::New()': write.cc: (.text._ZN6google8protobuf8internal18GenericTypeHandlerIN8tutorial6PersonEE3NewEv[google::protobuf::internal::GenericTypeHandlertutorial::Person::New()] +0x1c): undefined reference to `tutorial::Person::Person()' /tmp/cc62Lqqa.o: In function `tutorial::Person::mutable_name()': write.cc: (.text._ZN8tutorial6Person12mutable_nameEv[tutorial::Person::mutable_name()] +0x25): undefined reference to `tutorial::Person::_default_name_' /tmp/cc62Lqqa.o: In function `tutorial::Person::set_email(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)': write.cc: (.text._ZN8tutorial6Person9set_emailERKSs[tutorial::Person::set_email(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)]+0x29): undefined reference to `tutorial::Person::_default_email_' /tmp/cc62Lqqa.o: In function `tutorial::Person_PhoneNumber::set_number(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)': write.cc: (.text._ZN8tutorial18Person_PhoneNumber10set_numberERKSs[tutorial::Person_PhoneNumber::set_number(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)]+0x29): undefined reference to `tutorial::Person_PhoneNumber::_default_number_' /tmp/cc62Lqqa.o: In function `google::protobuf::internal::GenericTypeHandlertutorial::Person_PhoneNumber::New()': write.cc: (.text._ZN6google8protobuf8internal18GenericTypeHandlerIN8tutorial18Person_PhoneNumberEE3NewEv[google::protobuf::internal::GenericTypeHandlertutorial::Person_PhoneNumber::New()] +0x1c): undefined reference to `tutorial::Person_PhoneNumber::Person_PhoneNumber()' /tmp/cc62Lqqa.o: In function `tutorial::Person_PhoneNumber::set_type(tutorial::Person_PhoneType)': write.cc: (.text._ZN8tutorial18Person_PhoneNumber8set_typeENS_16Person_PhoneTypeE[tutorial::Person_PhoneNumber::set_type(tutorial::Person_PhoneType)] +0x13): undefined reference to `tutorial::Person_PhoneType_IsValid(int)' collect2: ld returned 1 exit status protobuf-2.3.0/examples$ What did I do wrong? Thanks a lot Zhang Bo On Apr 7, 9:20 am, Bo Zhang zhan...@google.com wrote: Following up to the previous test failure. I have cleaned to old one and downloaded a fresh one. This time make check passed all test. I'm trying to make install and testing examples now. I will post the result later However it would be nice to understand the reason behind the failure. Thanks Zhang Bo On Apr 7, 8:57 am, Bo Zhang zhan...@google.com wrote: Hi Steven, Thanks for your reply. In deed I was following the instructions. Anyway I had a rerun. Make check fails one test (again, which I forgot to mention before), as shown below: [==] 729 tests from 102 test cases ran. (2899 ms total) [ PASSED ] 728 tests. [ FAILED ] 1 test, listed below: [ FAILED ] BootstrapTest.GeneratedDescriptorMatches . . . . == 1 of 5 tests failed Please report to protobuf@googlegroups.com == Could anyone explain to me why this test fails? Seems to me that there's something wrong with version. How could I fix this? Thanks a lot Zhang Bo On Apr 6, 10:07 pm, Steven Ong stevenong2...@gmail.com wrote: Hi, You need to read and follow the instruction from the DIR/README.txt (DIR is where your protobuf-x.x.x resding) file to configure/compile/check/install the package before you can use it (That for the C++ portion). For the Java portion, you need to read and follow the instruction in the DIRjava/README.txt to build the library, after that, install your *.jar file according to the JAVA standard to use it. Hope this would help, Steven On Tue, Apr 6, 2010 at 2:19 AM, Bo Zhang zhan...@google.com wrote: Hi, I'm new to both protocol buffer and to linux system, so excuse me for simple questions. :) I try to make in the example directory. I got the following errors: ./protobuf-2.3.0/examples$ make pkg-config --cflags protobuf # fails if protobuf is not installed -pthread -I/usr/local/include c++ add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config -- cflags --libs protobuf` In file included from add_person.cc:6:
Re: [protobuf] Re: Tutorial example make failure
The test you mentioned verifies that descriptor.pb.{h,cc} and plugin.pb.{h,cc} that's in the source matches what the compiler would generate. The test can fail if you've made changes affecting what the compiler outputs, or if you've made changes to those files directly. On Tue, Apr 6, 2010 at 6:20 PM, Bo Zhang zhan...@google.com wrote: Following up to the previous test failure. I have cleaned to old one and downloaded a fresh one. This time make check passed all test. I'm trying to make install and testing examples now. I will post the result later However it would be nice to understand the reason behind the failure. Thanks Zhang Bo On Apr 7, 8:57 am, Bo Zhang zhan...@google.com wrote: Hi Steven, Thanks for your reply. In deed I was following the instructions. Anyway I had a rerun. Make check fails one test (again, which I forgot to mention before), as shown below: [==] 729 tests from 102 test cases ran. (2899 ms total) [ PASSED ] 728 tests. [ FAILED ] 1 test, listed below: [ FAILED ] BootstrapTest.GeneratedDescriptorMatches . . . . == 1 of 5 tests failed Please report to protobuf@googlegroups.com == Could anyone explain to me why this test fails? Seems to me that there's something wrong with version. How could I fix this? Thanks a lot Zhang Bo On Apr 6, 10:07 pm, Steven Ong stevenong2...@gmail.com wrote: Hi, You need to read and follow the instruction from the DIR/README.txt (DIR is where your protobuf-x.x.x resding) file to configure/compile/check/install the package before you can use it (That for the C++ portion). For the Java portion, you need to read and follow the instruction in the DIRjava/README.txt to build the library, after that, install your *.jar file according to the JAVA standard to use it. Hope this would help, Steven On Tue, Apr 6, 2010 at 2:19 AM, Bo Zhang zhan...@google.com wrote: Hi, I'm new to both protocol buffer and to linux system, so excuse me for simple questions. :) I try to make in the example directory. I got the following errors: ./protobuf-2.3.0/examples$ make pkg-config --cflags protobuf # fails if protobuf is not installed -pthread -I/usr/local/include c++ add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config -- cflags --libs protobuf` In file included from add_person.cc:6: addressbook.pb.h:9:42: error: google/protobuf/stubs/common.h: No such file or directory addressbook.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is addressbook.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update addressbook.pb.h:14:2: error: #error your headers. addressbook.pb.h:22:52: error: google/protobuf/ generated_message_util.h: No such file or directory ..(many more) My questions are: 1. Why it tells me that protobuf is not installed? 2. It keeps failing in finding google/protobuf/ files. Why does this happen? Thanks a lot Zhang Bo -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com protobuf%2bunsubscr...@googlegroups.c om . 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 proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@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 proto...@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: Tutorial example make failure
Thanks a lot for both of you. It works fine now. Zhang Bo On Apr 7, 10:16 am, Kenton Varda ken...@google.com wrote: protoc generates a .pb.cc file. You need to compile that too. On Tue, Apr 6, 2010 at 6:44 PM, Bo Zhang zhan...@google.com wrote: Hi guys, here I come again with errors I can't figure out. Basically I copied the code for writing a message from tutorial and pasted it into write.cc under directory examples. write.cc is supposed to invoke addressbook When I try to compile write.cc, I got the following: protobuf-2.3.0/examples$ c++ write.cc `pkg-config --cflags --libs protobuf` /tmp/cc62Lqqa.o: In function `main': write.cc:(.text+0x45c): undefined reference to `tutorial::AddressBook::AddressBook()' write.cc:(.text+0x673): undefined reference to `tutorial::AddressBook::~AddressBook()' write.cc:(.text+0x692): undefined reference to `tutorial::AddressBook::~AddressBook()' /tmp/cc62Lqqa.o: In function `google::protobuf::internal::GenericTypeHandlertutorial::Person::New()': write.cc: (.text._ZN6google8protobuf8internal18GenericTypeHandlerIN8tutorial6PersonEE 3NewEv[google::protobuf::internal::GenericTypeHandlertutorial::Person::Ne w()] +0x1c): undefined reference to `tutorial::Person::Person()' /tmp/cc62Lqqa.o: In function `tutorial::Person::mutable_name()': write.cc: (.text._ZN8tutorial6Person12mutable_nameEv[tutorial::Person::mutable_name() ] +0x25): undefined reference to `tutorial::Person::_default_name_' /tmp/cc62Lqqa.o: In function `tutorial::Person::set_email(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)': write.cc: (.text._ZN8tutorial6Person9set_emailERKSs[tutorial::Person::set_email(std:: basic_stringchar, std::char_traitschar, std::allocatorchar const)]+0x29): undefined reference to `tutorial::Person::_default_email_' /tmp/cc62Lqqa.o: In function `tutorial::Person_PhoneNumber::set_number(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)': write.cc: (.text._ZN8tutorial18Person_PhoneNumber10set_numberERKSs[tutorial::Person_P honeNumber::set_number(std::basic_stringchar, std::char_traitschar, std::allocatorchar const)]+0x29): undefined reference to `tutorial::Person_PhoneNumber::_default_number_' /tmp/cc62Lqqa.o: In function `google::protobuf::internal::GenericTypeHandlertutorial::Person_PhoneNumbe r::New()': write.cc: (.text._ZN6google8protobuf8internal18GenericTypeHandlerIN8tutorial18Person_ PhoneNumberEE3NewEv[google::protobuf::internal::GenericTypeHandlertutorial ::Person_PhoneNumber::New()] +0x1c): undefined reference to `tutorial::Person_PhoneNumber::Person_PhoneNumber()' /tmp/cc62Lqqa.o: In function `tutorial::Person_PhoneNumber::set_type(tutorial::Person_PhoneType)': write.cc: (.text._ZN8tutorial18Person_PhoneNumber8set_typeENS_16Person_PhoneTypeE[tut orial::Person_PhoneNumber::set_type(tutorial::Person_PhoneType)] +0x13): undefined reference to `tutorial::Person_PhoneType_IsValid(int)' collect2: ld returned 1 exit status protobuf-2.3.0/examples$ What did I do wrong? Thanks a lot Zhang Bo On Apr 7, 9:20 am, Bo Zhang zhan...@google.com wrote: Following up to the previous test failure. I have cleaned to old one and downloaded a fresh one. This time make check passed all test. I'm trying to make install and testing examples now. I will post the result later However it would be nice to understand the reason behind the failure. Thanks Zhang Bo On Apr 7, 8:57 am, Bo Zhang zhan...@google.com wrote: Hi Steven, Thanks for your reply. In deed I was following the instructions. Anyway I had a rerun. Make check fails one test (again, which I forgot to mention before), as shown below: [==] 729 tests from 102 test cases ran. (2899 ms total) [ PASSED ] 728 tests. [ FAILED ] 1 test, listed below: [ FAILED ] BootstrapTest.GeneratedDescriptorMatches . . . . == 1 of 5 tests failed Please report to protobuf@googlegroups.com == Could anyone explain to me why this test fails? Seems to me that there's something wrong with version. How could I fix this? Thanks a lot Zhang Bo On Apr 6, 10:07 pm, Steven Ong stevenong2...@gmail.com wrote: Hi, You need to read and follow the instruction from the DIR/README.txt (DIR is where your protobuf-x.x.x resding) file to configure/compile/check/install the package before you can use it (That for the C++ portion). For the Java portion, you need to read and follow the instruction in the DIRjava/README.txt to build the library, after that, install your *.jar file according to the JAVA standard to use it. Hope this would help, Steven On Tue, Apr 6, 2010 at 2:19 AM, Bo Zhang zhan...@google.com
[protobuf] Re: Issue 101 in protobuf: Compiling Protocol Buffer (64) using gcc in Sun 9 (libgcc_s.so: wrong ELF class: ELFCLASS32)
Comment #4 on issue 101 by fnjordy: Compiling Protocol Buffer (64) using gcc in Sun 9 (libgcc_s.so: wrong ELF class: ELFCLASS32) http://code.google.com/p/protobuf/issues/detail?id=101 Affects Solaris 10/SPARC with GCC installed from sunfreeware.com The extra GCC package is required because the stock GCC from Sun does not include 64- bit support. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to proto...@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.