awslabs / awslabs/aws-lambda-cpp

Undefined symbol errors when consuming the library as shared/dynamic

Ouverte
#205 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
465
Forks
98
Merge moyen
12 h 47 min
PR mergées (30 j)
3

Description

The `"-fvisibility=hidden"` (see [CMakeLists.txt#L77](https://github.com/awslabs/aws-lambda-cpp/blob/master/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")))`

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.