awslabs / awslabs/aws-lambda-cpp

Undefined symbol errors when consuming the library as shared/dynamic

Đang mở
#205 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
465
Fork
98
Merge trung bình
12 giờ 47 phút
Pull request đã merge (30 ngày)
3

Mô tả

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")))`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.