RE: [protobuf] Linker error

2013-03-05 Thread Mohammad Husain
That was it! I changed the order and it worked! $(CXX) -o hello_protobuf $(OBJS) $(LDFLAGS) Thanks a lot. Date: Tue, 5 Mar 2013 09:03:04 + Subject: Re: [protobuf] Linker error From: oliver.jow...@gmail.com To: farhan1...@hotmail.com CC: protobuf@googlegroups.com On Tue, Mar 5, 2013 at 2:25

Re: [protobuf] Linker error

2013-03-05 Thread Oliver Jowett
On Tue, Mar 5, 2013 at 2:25 AM, Mohammad Husain wrote: > > g++ `pkg-config --cflags --libs protobuf` -o hello_protobuf > hello_protobuf.o user.pb.o > Probably just argument ordering. The library reference (which will come from pkg-config --libs) needs to appear after the object files that refer t

RE: [protobuf] Linker error

2013-03-04 Thread Mohammad Husain
@chmod +x add_person_python list_people_python: list_people.py protoc_middleman @echo "Writing shortcut script list_people_python..." @echo '#! /bin/sh' > list_people_python @echo './list_people.py "$$@"' >> list_people_python @chmod +x list_people_python

RE: [protobuf] Linker error

2013-02-28 Thread Mohammad Husain
I added that but nothing changed :( > Date: Thu, 28 Feb 2013 17:13:57 -0500 > Subject: Re: [protobuf] Linker error > From: imir...@alum.mit.edu > To: farhan1...@hotmail.com > CC: protobuf@googlegroups.com > > There's a -c missing... the line should be like > >

Re: [protobuf] Linker error

2013-02-28 Thread Ilia Mirkin
13 17:00:21 -0500 > >> Subject: Re: [protobuf] Linker error >> From: imir...@alum.mit.edu >> To: farhan1...@hotmail.com >> CC: protobuf@googlegroups.com >> >> Hmmm... I must have misremembered how Makefile stuff works, my bad. >> Instead of $(pkg-config --cflags

RE: [protobuf] Linker error

2013-02-28 Thread Mohammad Husain
I tried that but unfortunately no luck yet: http://pastebin.com/Ln4AC7fH. > Date: Thu, 28 Feb 2013 17:00:21 -0500 > Subject: Re: [protobuf] Linker error > From: imir...@alum.mit.edu > To: farhan1...@hotmail.com > CC: protobuf@googlegroups.com > > Hmmm... I must have misre

Re: [protobuf] Linker error

2013-02-28 Thread Ilia Mirkin
= hello_protobuf.o user.pb.o > > hello_protobuf: $(OBJS) protoc_middleman > pkg-config --cflags protobuf # fails if protobuf is not installed > $(CXX) $(LFLAGS) -o hello_protobuf $(OBJS) > > clean: > \rm *.o > \rm hello_protobuf 2>/dev/null || true >

RE: [protobuf] Linker error

2013-02-28 Thread Mohammad Husain
$(CXX) $(LFLAGS) -o hello_protobuf $(OBJS) clean: \rm *.o \rm hello_protobuf 2>/dev/null || true > Date: Thu, 28 Feb 2013 15:41:00 -0500 > Subject: Re: [protobuf] Linker error > From: imir...@alum.mit.edu > To: farhan1...@hotmail.com > CC: protobuf@googlegroups.com >

Re: [protobuf] Linker error

2013-02-28 Thread Ilia Mirkin
add_person_python: add_person.py protoc_middleman > @echo "Writing shortcut script add_person_python..." > @echo '#! /bin/sh' > add_person_python > @echo './add_person.py "$$@"' >> add_person_python > @chmod +x

RE: [protobuf] Linker error

2013-02-28 Thread Mohammad Husain
I actually had the rule but after comparing my Makefile with the one in the examples directory I removed it hoping that would fix the issue. Date: Thu, 28 Feb 2013 15:46:55 +0800 Subject: Re: [protobuf] Linker error From: xiaof...@google.com To: farhan1...@hotmail.com CC: protobuf

RE: [protobuf] Linker error

2013-02-28 Thread Mohammad Husain
_people_python..." @echo '#! /bin/sh' > list_people_python @echo './list_people.py "$$@"' >> list_people_python @chmod +x list_people_python > Date: Thu, 28 Feb 2013 02:48:08 -0500 > Subject: Re: [protobuf] Linker error > From: im

Re: [protobuf] Linker error

2013-02-27 Thread Ilia Mirkin
You don't appear to include the path to protobuf when compiling user.pb.o -- there's no explicit rule so it'll just $(CXXFLAGS). You should either add %.pb.o: %.pb.cc $(CC) $(CXXFLAGS) $(pkgconfig --cflags protobuf) -o $@ $^ Or add CXXFLAGS = $(pkgconfig --cflags protobuf) at the top, which w

Re: [protobuf] Linker error

2013-02-27 Thread Feng Xiao
On Thu, Feb 28, 2013 at 5:01 AM, Mohammad Husain wrote: > I am having a bizarre linker problem with the simple program I wrote with > protobuf. When I run the make command I see tons of linker errors like the > following: > > user.pb.o:(.rodata._ZTIN4misc4UserE[_ZTIN4misc4UserE]+0x10): undefined >

[protobuf] Linker error

2013-02-27 Thread Mohammad Husain
I am having a bizarre linker problem with the simple program I wrote with protobuf. When I run the make command I see tons of linker errors like the following: user.pb.o:(.rodata._ZTIN4misc4UserE[_ZTIN4misc4UserE]+0x10): undefined reference to `typeinfo for google::protobuf::Message' user.pb.o:

[protobuf] Linker error when using Protocol Buffers

2012-10-08 Thread Patryk Steckel
I generated serial.pb.h and serial.pb.cc using protoc. Then I added those files to project and I got linker errors. Can anyone help? main.cpp: #include "serial.pb.h" int main() { Person person; person.set_name("Patryk"); return 0; } Output: 1>-- Build started: Project: Seriali