Dears,

I've managed to build libprotobuf.dll, the dynamic version, and this
fixed the issue.

But now MY code is not working at all.

I would like to manually enumerate the available extensions to my
RpcMessage. This is easily done by using an ExtensionFactory in Java
code.
In C++ it's not there, so we tried to use the
google::protobuf::Descriptor, but neither the extension_count and
field_count keep track of the created extensions.

Do we have to manually manage the set of known extensions?
Pretending that I managed to know the field assigned to that
extension, the following code is going to work in order to assing the
value to that extension field by using reflection?

        const google::protobuf::Reflection* reflection =
rpcMessage.GetReflection();
        google::protobuf::Message* msg = reflection->MutableMessage
(&rpcMessage, field);
        msg->CopyFrom(*response);


Thanks in advance again.

Carlo

On 1 Ott, 09:46, Carlo Medas <carlome...@gmail.com> wrote:
> Dears,
>
> we have rpc.proto with a base message, then mathpeer.proto with
> messages that extend the base RpcMessage.
>
> The rpc.proto is built and compiled inside a core.dll, using the --
> cpp_out=dllexport_decl directive you explained us before.
> The mathpeer.proto is built inside an exe which is linked against
> core.dll and libprotobuf (static version).
>
> We get the folowing errors as soon as we try to use some message of
> the mathpeer proto:
>
> libprotobuf ERROR ..\src\google\protobuf\descriptor.cc:2219] Invalid
> proto descriptor for file "mathpeer.proto":
> libprotobuf ERROR ..\src\google\protobuf\descriptor.cc:2222]
> mathpeer.proto: Import "rpc.proto" was not found or had errors.
> libprotobuf ERROR ..\src\google\protobuf\descriptor.cc:2222]
> overlook.rpc.math.peerInfoRequest: ".overlook.rpc.RpcMessage" is not
> defined.
> libprotobuf ERROR ..\src\google\protobuf\descriptor.cc:2222]
> overlook.rpc.math.peerInfoResponse: ".overlook.rpc.RpcMessage" is not
> defined.
> libprotobuf FATAL ..\..\..\..\src\tool\rpctest\mathpeer.pb.cc:33]
> CHECK failed: file != NULL:
>
> It seems to me that the extension registry is not the same for DLL and
> EXE, or something like that.
> As I've been reading some other thread, could this be caused by the
> fact that we are linking to a static libprotobuf in both DLL and exe?
>
> Thanks in advance,
>
> 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 protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to