If you are just trying to run the examples you shouldn't use the g++ 
command. Instead, follow the steps in the README 
<https://github.com/protocolbuffers/protobuf/tree/master/examples#readme>, 
specifically under "Build the example using make".'

The g++ command you are trying to run is only to compile dependent packages 
(which isn't needed to run the examples). 

On Thursday, January 20, 2022 at 9:06:55 PM UTC-8 [email protected] wrote:

> /tmp/cc4oF0nm.o: In function `tutorial::Person_PhoneType_descriptor()':
> addressbook.pb.cc:(.text+0x1e): undefined reference to 
> `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable
>  
> const*, bool)'
>
> There are many similar errors when I run 
> ”g++ addressbook.pb.cc add_person.cc -o main `pkg-config --cflags --libs 
> protobuf` 
> ”in ~/protobuf/examples
>
> Here's how I installed 3.19.3: 
> ./configure --prefix=/usr
> make -j8 make check -j8 #7 pass sudo make install 
> sudo ldconfig
>
> I have tried 2.x.x and 3.19.3, both are wrong, include ROS melodic. 
> And I tried to delete all file like "/include/proto*" and "libproto*" 
> except file of Anaconda and python. And then I tried to install 
> again, problem was as usual :(. 
> I have no idea how to fix this. 
>

-- 
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/7035c491-64a6-4118-ac47-b224dc6ebffan%40googlegroups.com.

Reply via email to