Skip to content

$dllexport_decl$ is missing in generated .pb.cc #13084

@owent

Description

@owent

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?

  1. Using --cpp_out=dllexport_decl=XXX_API:<OUTPUT DIR>.
  2. Set the visibility to hidden.
  3. Build generated .pb.cc as shared libraries.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions