Undefined symbol errors when consuming the library as shared/dynamic
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- cmake, cpp
- 领域
- build-system
调研方向
从 CMakeLists.txt#L77 中的可见性设置开始,并在以 shared object 形式使用库时重现 undefined-symbol 错误。比较列出的可见性方案,并确认所选更改在保留静态库使用方式的同时,公开 shared-library consumers 所需的符号。
由索引模型根据 Issue 内容生成。
描述
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:
- 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. - Keep
"-fvisibility=hidden"and manually annotate symbols intended to be public with:__attribute__((visibility("default"))), however, this will require a significant amount of effort. - Replace
"-fvisibility=hidden"with"-fvisibility=default"and manually annotate symbols intended to be private with__attribute__((visibility("hidden")))
- 主要语言
- C++
- 星标
- 465
- 派生
- 98
- 平均合并
- 1 小时 16 分钟
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
awslabs/aws-lambda-cpp 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
awslabs/aws-lambda-cpp#196 ·
-
难度 4/5 3-5 天 新手友好度 35/100
awslabs/aws-lambda-cpp#195 · 11 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
awslabs/aws-lambda-cpp#194 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
awslabs/aws-lambda-cpp#188 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
awslabs/aws-lambda-cpp#170 ·
查看 awslabs/aws-lambda-cpp 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
AXERA-TECH/ax-llm#77 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
games-on-whales/wolf#509 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 74/100
-
bug-unconfirmed
难度 2/5 1-3 小时 新手友好度 76/100