What version of protobuf and what language are you using?
Version: v21/v23
Language: C++
What operating system (Linux, Windows, ...) and version?
Windows,Linux
What runtime / compiler are you using (e.g., python version or gcc version)
GCC 13, GCC 4.8, MSVC 19.36
What did you do?
- Using
--cpp_out=dllexport_decl=XXX_API:<OUTPUT DIR>.
- Set the visibility to hidden.
- Build generated
.pb.cc as shared libraries.
- See error
What did you expect to see
Linking success.
What did you see instead?
Unresolved reference to PACKAGE::_MESSAGE_default_instance_.
Anything else we should know about your project / environment
$dllexport_decl$ is missing for default instance in generated .pb.cc.
What version of protobuf and what language are you using?
Version: v21/v23
Language: C++
What operating system (Linux, Windows, ...) and version?
Windows,Linux
What runtime / compiler are you using (e.g., python version or gcc version)
GCC 13, GCC 4.8, MSVC 19.36
What did you do?
--cpp_out=dllexport_decl=XXX_API:<OUTPUT DIR>..pb.ccas shared libraries.What did you expect to see
Linking success.
What did you see instead?
Unresolved reference to
PACKAGE::_MESSAGE_default_instance_.Anything else we should know about your project / environment
$dllexport_decl$is missing for default instance in generated.pb.cc.