Thanks. It worked out.

But now I',m getting anothere error (sorry, but I'm newbie also in the
linux OS):
./addPerson: error while loading shared libraries: libprotoc.so.3:
cannot open shared object file: No such file or directory

I've tried to put the /lib which contains this file in the path but it
didn't work. Also tried a sysmbolic link, but it also didn't work. Do
you know what could be that?

best regards,

                                      Rodrigo

On Dec 8, 7:14 pm, Kenton Varda <[EMAIL PROTECTED]> wrote:
> Please use the Makefile to build.  In this case, your problem is that you
> are not linking addressbook.pb.cc into the binary.
>
> On Sun, Dec 7, 2008 at 11:07 AM, Rodrigo_Dias_Ferreira
> <[EMAIL PROTECTED]>wrote:
>
>
>
> > Hi,
>
> > I was trying to run the example which it comes with the src of the
> > protobuf (AddressBook), and
> > got the following error:
>
> > [EMAIL PROTECTED]:~/Master/software/protobuf/google/examples/test$ g++ -g3
> > -lprotobuf -lprotoc add_person.o -o addPerson
> > add_person.o: In function `main':
> > /home/rodrigo/Master/software/protobuf/google/examples/test/
> > add_person.cc:66: undefined reference to
> > `tutorial::AddressBook::AddressBook()'
> > /home/rodrigo/Master/software/protobuf/google/examples/test/
> > add_person.cc:91: undefined reference to
> > `tutorial::AddressBook::~AddressBook()'
> > /home/rodrigo/Master/software/protobuf/google/examples/test/
> > add_person.cc:91: undefined reference to
> > `tutorial::AddressBook::~AddressBook()'
> > add_person.o: In function
> > `google::protobuf::RepeatedPtrField<tutorial::Person>::NewElement()':
> > /home/rodrigo/Master/software/protobuf/include/google/protobuf/
> > repeated_field.h:736: undefined reference to `tutorial::Person::Person
> > ()'
> > add_person.o: In function `tutorial::Person::mutable_name()':
> > /home/rodrigo/Master/software/protobuf/google/examples/test/
> > addressbook.pb.h:412: undefined reference to
> > `tutorial::Person::_default_name_'
> > add_person.o: In function `tutorial::Person::set_email
> > (std::basic_string<char, std::char_traits<char>, std::allocator<char>
> > > const&)':
> > /home/rodrigo/Master/software/protobuf/google/examples/test/
> > addressbook.pb.h:449: undefined reference to
> > `tutorial::Person::_default_email_'
> > add_person.o: In function `tutorial::Person_PhoneNumber::set_number
> > (std::basic_string<char, std::char_traits<char>, std::allocator<char>
> > > const&)':
> > /home/rodrigo/Master/software/protobuf/google/examples/test/
> > addressbook.pb.h:342: undefined reference to
> > `tutorial::Person_PhoneNumber::_default_number_'
> > add_person.o: In function
>
> > `google::protobuf::RepeatedPtrField<tutorial::Person_PhoneNumber>::NewElement
> > ()':
> > /home/rodrigo/Master/software/protobuf/include/google/protobuf/
> > repeated_field.h:736: undefined reference to
> > `tutorial::Person_PhoneNumber::Person_PhoneNumber()'
> > add_person.o: In function `tutorial::Person_PhoneNumber::set_type
> > (tutorial::Person_PhoneType)':
> > /home/rodrigo/Master/software/protobuf/google/examples/test/
> > addressbook.pb.h:374: undefined reference to
> > `tutorial::Person_PhoneType_IsValid(int)'
> > collect2: ld returned 1 exit status
>
> > My enviroment variables:
> > export MASTER_SOFTWARE=/home/rodrigo/Master/software
> > export SOFT=$MASTER_SOFTWARE
>
> > export PROTOBUF=${SOFT}/protobuf
>
> > PATH=${PATH}:${PROTOBUF}/bin/
> > export PATH
>
> > CPATH=${CPATH}:.
> > CPATH=${CPATH}:${PROTOBUF}/include/
> > export CPATH
>
> > OBJC_INCLUDE_PATH=${OBJC_INCLUDE_PATH}:.
> > OBJC_INCLUDE_PATH=${OBJC_INCLUDE_PATH}:${PROTOBUF}/include/
> > export OBJC_INCLUDE_PATH
>
> > C_INCLUDE_PATH=${C_INCLUDE_PATH}:.
> > C_INCLUDE_PATH=${C_INCLUDE_PATH}:${PROTOBUF}/include/
> > export C_INCLUDE_PATH
>
> > CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:.
> > CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:${PROTOBUF}/include/
> > export CPLUS_INCLUDE_PATH
>
> > LIBRARY_PATH=${LIBRARY_PATH}:.
> > LIBRARY_PATH=${LIBRARY_PATH}:${PROTOBUF}/lib/
> > export LIBRARY_PATH
>
> > Remark: If I just compile, it works. But when I try to link, it
> > doesn't.
>
> > I've already tried several things, but it didn't work. Perhaps I am
> > missing some detail that I am not aware.
>
> > Any ideas how to solve?
>
> > Thanks,
>
> >                                          Rodrigo
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to