The problem is the way the static initializers work. If you export the classes from a .pb.cc file as part of a shared library (.so), their initializers will run every time you load the .so. But these initializers need to add entries to tables which are in libprotobuf.so, and the same descriptor cannot be added twice. So, anything that causes your message class .so to be loaded more times than the main protobuf .so is going to abort on a GOOGLE_CHECK at runtime. For example, unloading and reloading the .so with dlopen(), or loading more than one .so module which has the message .so as a dependency.
(Note this is not an issue with Windows .DLL modules.) -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/LNpUy4oF19QJ. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.