Dear Kenton and Aron,

thank you very much for your prompt answers.

With Kenton's suggestion, we were able to have our custom
OVERLOOK_EXPORT macro in the generated .pb files.

By using Aron's idea we then managed to force inclusion of our
exports.h file.

Thank you all again.
Kind regards,


On 22 Set, 21:20, Aron Bierbaum <> wrote:
> We currently get around this limitation by forcing the the header to
> be included using compiler command line flags:
> Windows: /FIproject/Config.h
> Linux: -include project/Config.h
> -Aron
> On Tue, Sep 22, 2009 at 11:37 AM, Kenton Varda <> wrote:
> > If you invoke protoc like:
> >   protoc --cpp_out=dllexport_decl=MY_EXPORT_MACRO:path/to/output/dir
> > myproto.proto
> > then it will generate code with MY_EXPORT_MACRO in all the right places.
> >  However, this option is incomplete -- currently there is no way to force
> > the generated .pb.h to #include a header which defines MY_EXPORT_MACRO.  I'm
> > open to patches to fix this.  Or, you could use a hack to work around it,
> > such as adding the #include via some sort of text processing after protoc
> > finishes, or perhaps moving the .pb.h to .pb2.h and replacing the .pb.h file
> > with one that first includes your header then includes the .pb2.h...
> > On Tue, Sep 22, 2009 at 1:14 AM, Carlo Medas <> wrote:
> >> Dears,
> >> we have a rpc.proto built inside our core framework, built as a DLL.
> >> Other protos contain extension to base message defined in rpc.proto,
> >> and they are built in separate and different executables.
> >> The MSVC linker compains for error since the RpcMessage class (defined
> >> in rpc.proto) and related extension factory methods are not declared
> >> with __declspec(dllexport) option when built in the DLL.
> >> Is there an option in the protoc compiler to make it generate the
> >> dllexport/dllimport options, exactly as you did for your Message base
> >> class with macro LIBPROTOBUF_EXPORT?
> >> Thanks in advance and keep up the amazing work,
> >> Carlo Medas
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to