Hi Adam,Jie,
I am really sorry . Issue was becasue the shared library was compiled with
hidden visibiltiy . I have to take care of compiling protobuf classes
compiled as part of shared library with default visibility . I would
correct that . Sorry for the trouble .

Regards
Vinay Shivakumar

On Fri, May 10, 2019 at 4:02 AM Adam Cozzette <[email protected]> wrote:

> I haven't heard of any problems using the inline accessors with shared
> libraries before. Vinay, if you could post a small reproducible example
> then I could try to take a look. I don't think there is any way to disable
> the inlining.
>
> *From: *Jie Luo <[email protected]>
> *Date: *Thu, May 9, 2019 at 10:03 AM
> *To: *Vinay Shivakumar, Adam Cozzette
>
> +Adam Cozzette <[email protected]>  for C++ generated code
>>
>> On Wed, May 8, 2019 at 8:24 PM Vinay Shivakumar <[email protected]>
>> wrote:
>>
>>> Hi Jie,
>>> Thanks for your reply.
>>> Using C++ protobuf . Suppose i have message(class) as a member of
>>> another message(class)  . the function being generated to get an instance
>>> of the inner message is inline . I understand its left to compiler to
>>> consider the function for inline . Its not just the functions . even the
>>> classes generated in pb.h for corresponding message in proto.h having
>>> undefined reference . when i use  defualt visibility
>>> (__attribute__((visibility( default ))) ) for protobuf class manually and
>>> compile , symbol of the class appear in the .so shared library . This
>>> essentially means that protobuf classes are generated with hidden
>>> visibility . is it possible to have protobuf classes generated with default
>>> visibility so that they can be used across the shared library ?
>>>
>>> On Wed, May 8, 2019 at 10:42 PM 'Jie Luo' via Protocol Buffers <
>>> [email protected]> wrote:
>>>
>>>> What language of protobuf are you using?  We have public APIs for
>>>> getters and setters. You can look into our web to see how to use them:
>>>>
>>>> https://developers.google.com/protocol-buffers/docs/reference/cpp-generated
>>>> <https://developers.google.com/protocol-buffers/docs/reference/cpp-generated?hl=zh-CN>
>>>>
>>>> On Tuesday, May 7, 2019 at 11:29:57 PM UTC-7, Vinay Shivakumar wrote:
>>>>>
>>>>> Hi ,
>>>>>
>>>>> I have a requirement where i need to use the generated functions like
>>>>> getters and setters from generated protobuf classes in different shared
>>>>> library other than where it is generated and built . all the funtions
>>>>> generated is "inlined" . because of this , i am getting undefined 
>>>>> reference
>>>>> in shared library where i am using it .
>>>>>
>>>>> I have two questions :
>>>>> 1) is there any way to generate functions without inline ? is it
>>>>> recommended if possible ?
>>>>> 2) if inlining removal is not suggested , how do we reference the
>>>>> functions in different shared library ? some sort of wrapper for each
>>>>> getters and setters i want to use ?
>>>>>
>>>>> Request your suggestions .
>>>>>
>>>>> Thanks
>>>>> Vinay Shivakumar
>>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Protocol Buffers" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at https://groups.google.com/group/protobuf.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/protobuf/60889d0a-b599-4931-9850-c5dafe832b72%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/protobuf/60889d0a-b599-4931-9850-c5dafe832b72%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CADNzSO7nThMgXUoeeXNu6eSPonPSrBNdzXyU2Vv_H6CvuB7FjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to