Did you figure this problem out? I'm having the same issue using Android 
Studio and trying to compile the protobuf stuff for my project.

Regards,
Mike


On Wednesday, August 22, 2012 5:12:52 AM UTC-7, mjetuljcek wrote:
>
> Hi, everyone!
>  
> I'm strugling for a cuple of days with compiling and linkig C++ tutorial 
> example (Read/Write Message) and getting this errors:
>  
> --------------------Configuration: add_person - Debug--------------------
> Linking...
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `main':
> C:\MinGWStudio\Exercises\PB_add_person\add_person.cc:57: undefined 
> reference to `google::protobuf::internal::VerifyVersion(int, int, char 
> const*)'
> C:\MinGWStudio\Exercises\PB_add_person\add_person.cc:64: undefined 
> reference to `tutorial::AddressBook::AddressBook()'
> C:\MinGWStudio\Exercises\PB_add_person\add_person.cc:71: undefined 
> reference to `google::protobuf::Message::ParseFromIstream(std::istream*)'
> C:\MinGWStudio\Exercises\PB_add_person\add_person.cc:83: undefined 
> reference to `google::protobuf::Message::SerializeToOstream(std::ostream*) 
> const'
> C:\MinGWStudio\Exercises\PB_add_person\add_person.cc:90: undefined 
> reference to `google::protobuf::ShutdownProtobufLibrary()'
> C:\MinGWStudio\Exercises\PB_add_person\add_person.cc:64: undefined 
> reference to `tutorial::AddressBook::~AddressBook()'
> C:\MinGWStudio\Exercises\PB_add_person\add_person.cc:64: undefined 
> reference to `tutorial::AddressBook::~AddressBook()'
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `ZN8tutorial18Person_PhoneNumber10set_numberERKSs':
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:418: undefined 
> reference to `google::protobuf::internal::kEmptyString'
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `ZN8tutorial18Person_PhoneNumber8set_typeENS_16Person_PhoneTypeE':
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:473: undefined 
> reference to `tutorial::Person_PhoneType_IsValid(int)'
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:473: undefined 
> reference to 
> `google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel,
>  
> char const*, int)'
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:473: undefined 
> reference to `google::protobuf::internal::LogMessage::operator<<(char 
> const*)'
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:473: undefined 
> reference to 
> `google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)'
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:473: undefined 
> reference to `google::protobuf::internal::LogMessage::~LogMessage()'
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:473: undefined 
> reference to `google::protobuf::internal::LogMessage::~LogMessage()'
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `ZN8tutorial6Person12mutable_nameEv':
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:524: undefined 
> reference to `google::protobuf::internal::kEmptyString'
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `ZN8tutorial6Person9set_emailERKSs':
> C:\MinGWStudio\Exercises\PB_add_person\Lib\addressbook.pb.h:583: undefined 
> reference to `google::protobuf::internal::kEmptyString'
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `ZN6google8protobuf8internal20RepeatedPtrFieldBase3AddINS0_16RepeatedPtrFieldIN8tutorial18Person_PhoneNumberEE11TypeHandlerEEEPNT_4TypeEv':
> c:\mingwstudio\mingw\bin\..\lib\gcc\mingw32\4.6.2\..\..\..\..\include\google\protobuf\repeated_field.h:675:
>  
> undefined reference to 
> `google::protobuf::internal::RepeatedPtrFieldBase::Reserve(int)'
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `ZN6google8protobuf8internal20RepeatedPtrFieldBase3AddINS0_16RepeatedPtrFieldIN8tutorial6PersonEE11TypeHandlerEEEPNT_4TypeEv':
> c:\mingwstudio\mingw\bin\..\lib\gcc\mingw32\4.6.2\..\..\..\..\include\google\protobuf\repeated_field.h:675:
>  
> undefined reference to 
> `google::protobuf::internal::RepeatedPtrFieldBase::Reserve(int)'
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `ZN6google8protobuf8internal18GenericTypeHandlerIN8tutorial18Person_PhoneNumberEE3NewEv':
> c:\mingwstudio\mingw\bin\..\lib\gcc\mingw32\4.6.2\..\..\..\..\include\google\protobuf\repeated_field.h:276:
>  
> undefined reference to `tutorial::Person_PhoneNumber::Person_PhoneNumber()'
> C:\MinGWStudio\Exercises\PB_add_person\Debug\add_person.o: In function 
> `ZN6google8protobuf8internal18GenericTypeHandlerIN8tutorial6PersonEE3NewEv':
> ()'
> collect2: ld returned 1 exit status
> add_person.exe - 19 error(s), 0 warning(s)
>
> -----------------------------------------------------------------------------------------
> I'm using MinGwDeveloperStudio 2.05, MinGw C++ compiler 4.6.2, Protocol 
> buffers 2.4.1. and Windows7. I have succesfully (I hope so) 
> implemented/installed protocol buffers library into MinGw standard library 
> (follow the instruction in readme file). From addressbook.proto file i have 
> done addressbook.pb.cc and addressbook.pb.h files. I know that problem is 
> somehove connected with converting addressbook.pb.cc into binary file 
> when linking source file, i don't know how to solve the problem. I'm quit 
> new in C++ programing and protocol buffers. If someone can help me please, 
> i would realy apritiate.
>  
> With best regards! 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to