You will also have to include your protobuf generated code from address_book.pb.cc (generated by protoc).
On Tue, Jul 30, 2019 at 10:39 AM A <[email protected]> wrote: > Didn't work > * :(* > > *g++ main.cpp -L/usr/local/lib -lprotobuf* > > /usr/bin/ld: /tmp/ccJZGkWr.o: in function `main': > main.cpp:(.text+0xab): undefined reference to > `addressBook::AddressBook::AddressBook()' > /usr/bin/ld: main.cpp:(.text+0x15b): undefined reference to > `addressBook::AddressBook::~AddressBook()' > /usr/bin/ld: main.cpp:(.text+0x194): undefined reference to > `addressBook::AddressBook::~AddressBook()' > collect2: error: ld returned 1 exit status > > * g++ main.cpp -L/usr/local/lib -libprotobuf* > /usr/bin/ld: cannot find -libprotobuf > collect2: error: ld returned 1 exit status > > > On Tuesday, 30 July 2019 23:04:46 UTC+5:30, sachin chadha wrote: >> >> How about this >> >> *g++ main.cpp -L/usr/local/lib -lprotobuf* >> >> >> >> On Tue, 30 Jul 2019 at 19:24, A <[email protected]> wrote: >> >>> Hi All, >>> >>> This may be a silly question but I'm unable to compile my C++ code with >>> protobuf on ubuntu. >>> I've installed it in /usr/local/ and while running below command >>> >>> *g++ main.cpp -L/usr/local/lib -l lprotobuf* >>> >>> I get this error. >>> >>> /usr/bin/ld: cannot find -llprotobuf >>> collect2: error: ld returned 1 exit status >>> >>> Can someone help me in this regard ? >>> >>> -- >>> 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 view this discussion on the web visit >>> https://groups.google.com/d/msgid/protobuf/23ea5b48-c57f-43f1-9934-88728e46913e%40googlegroups.com >>> <https://groups.google.com/d/msgid/protobuf/23ea5b48-c57f-43f1-9934-88728e46913e%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/protobuf/7ce59ca5-70eb-423b-8d7b-e84c3baa0244%40googlegroups.com > <https://groups.google.com/d/msgid/protobuf/7ce59ca5-70eb-423b-8d7b-e84c3baa0244%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CADqAXr5jcbHk8F%3Dhhn%3DWECELG5BQ7dE26jK%2BLeQAjpAKJe1yaw%40mail.gmail.com.
