$EXPORT PLUGIN_EXPORT
$INCLUDE <dso/DSOVisibility.hh>
class PLUGIN_EXPORT FileNotFound : public Exception { ... };

PLUGIN_EXPORT std::string descriptionHead( std::string const & message );
[[noreturn]] PLUGIN_EXPORT void ThrowFileNotFound( ... );

The macro goes before each generated class name and each free function declaration in the header; members of the generated classes are covered by the class. It is meant for libraries built with hidden default visibility (-fvisibility=hidden) or as a Windows DLL — the macro expands to the compiler's export / import attribute.

Define the macro in a header and $INCLUDE it. $EXPORT alone removes the macro; the last $EXPORT in the module wins.

See the dsold walkthrough and Messages in a Shared Library.