title: Several shared object using same proto leading the the error: file already exists in database
body: <p>An error related to protobuf3</p>
  
  <p>I have a project that have an c++ executable core, and several shared objects (.so, .dll) called plugins. When the core launches, it will load those plugins with dlopen. The core and plugins using protobuf as communication protocol, so they have to compile the generated <code>.pb.cc</code> and <code>.ph.h</code> files into their binaries to have the copy of the serializer/deserializer. And <code>libprotobuf.so</code> link to both the core and plugins. When I launch the core, it crushes with error: file already exists in database, same error in <a href="https://github.com/google/protobuf/issues/863" rel="nofollow">#863</a></p>
  
  <p>I'm using protobuf-3 beta2, and Ubuntu 14.04. This error only happens on Linux. The program works fine on Windows and OS X.</p>
  
  <p>I have also tried another way which compile all the generated protobuf files into a dynamic library (<code>protocol.so</code>), then the core and plugins were linked to <code>protocol.so</code> and <code>libprotobuf.so</code>. This works fine. Of course, because in <a href="https://github.com/google/protobuf/pull/1062" rel="nofollow">#1062</a> the bug has been fixed. But when I changed the <code>protocol.so</code> into <code>protocol.a</code>, it failed again. I think it is same as compile generated <code>.pb.cc</code> separately.</p>
  
  <p>I don't want to compile a <code>protocol.so</code>, because it is inconvenient for me to extend the communication protocol when I add more and more plugins. I think compile the generated <code>.pb.cc</code> into the plugin's binary is better (this work well on windows and OS X).</p>
  
  <p>Any suggestions to fix this error are appreciated.</p>