Skip to content
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

Undefined symbol errors when consuming the library as shared/dynamic #205

Open
BwL1289 opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@BwL1289
Copy link

BwL1289 commented Nov 14, 2024

The "-fvisibility=hidden" (see CMakeLists.txt#L77) in CMakeLists.txt causes undefined symbols errors when using this library as shared object.

It's not a problem when using it as a static library because visibility settings doesn't affect that by design.

There are multiple solutions for this problem:

  1. Just remove "-fvisibility=hidden". We are currently using this approach as a workaround because we currently don't have many symbols to be considered private, this may be a viable option.
  2. Keep "-fvisibility=hidden" and manually annotate symbols intended to be public with: __attribute__((visibility("default"))), however, this will require a significant amount of effort.
  3. Replace "-fvisibility=hidden" with "-fvisibility=default" and manually annotate symbols intended to be private with __attribute__((visibility("hidden")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant