You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added some source code of 3rd-party libraries into the project
Everything is OK if they are built with static link
But if build as shared library and dynamic linked on Linux platform, I got a lot of "undefined reference" error
After some investigation I found "-fvisibility=hidden" in root CMakeLists.txt, which turn off global symbol exportation on shared library by default
In Baikal source code we have: attribute((visibility ("default"))), so any specified symbol can still be exported
That's why any 3rd-party source code without attribute((visibility ("default"))) can't be built as shared library
And in my case, the worst part is:
This library did not define any API_ENTRY macro
On Windows, CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is set, so CMAKE will help to export all symbols
On Linux, the default behavior of gcc is expected to export all symbols
So I have to modify all function declaration to make it work
Or just remove -fvisibility=hidden, and add it back as individual compiler flag to Baikal targets, which is more reasonable
The text was updated successfully, but these errors were encountered:
I added some source code of 3rd-party libraries into the project
Everything is OK if they are built with static link
But if build as shared library and dynamic linked on Linux platform, I got a lot of "undefined reference" error
After some investigation I found "-fvisibility=hidden" in root CMakeLists.txt, which turn off global symbol exportation on shared library by default
In Baikal source code we have: attribute((visibility ("default"))), so any specified symbol can still be exported
That's why any 3rd-party source code without attribute((visibility ("default"))) can't be built as shared library
And in my case, the worst part is:
This library did not define any API_ENTRY macro
On Windows, CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is set, so CMAKE will help to export all symbols
On Linux, the default behavior of gcc is expected to export all symbols
So I have to modify all function declaration to make it work
Or just remove -fvisibility=hidden, and add it back as individual compiler flag to Baikal targets, which is more reasonable
The text was updated successfully, but these errors were encountered: