New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export symbols used in inline functions #2407
Conversation
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
1 similar comment
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Mmm, the change works well in Chromium, but it doesn't seem to work very well here :/ |
It's better after having regenerated descriptor proto, the windows build is still broken though. Maybe I should deinline functions instead of trying to export symbol ? What do you think ? |
deinline is usually not an acceptable solution because of its performance impact. Our appveyor already covers DLL build and it's passing without this pull request. Could it be a build setup problem of Chrome? |
Ok.
That's what I do not understand yet : why Windows version builds fine without my patch and fails with it when we use protobuf as a shared library ? (whereas Linux is fine). For instance :
So when protobuf is a shared library, the symbol google::protobuf::internal::fixed_address_empty_string is hidden in it :
So when a piece of code from another module includes generated_message_util.h and links with protobuf shared library, there is an undefined reference to google::protobuf::internal::fixed_address_empty_string as the symbol is hidden. Am I missing something here ? |
I am unable to build version 3.1.0 on windows with MSVS CE 2015. Getting an unresolved external symbol on:
and
Any hints where I can look into to fix the source? |
Does this pull request fix your issue @thirdknife ? Especially this commit : 8a07630 |
This fails the protobuf build with the following error:
|
77805f0
to
107c5e2
Compare
fixed_address_empty_string symbol is used in an inline function. We have to export it to avoid undefined reference link errors.
107c5e2
to
788d14a
Compare
I made the mistake of exporting the symbol definition in the source file instead of exporting its declaration in the header file. |
Follow-up : #2462 |
fixed_address_empty_string and default_instance symbols
are used in inline functions. We have to export them properly to
avoid undefined reference link errors.