My code crashes with static library but not dynamic library #2123
-
I am having a crash for AWS-SDK-CPP on macOS(Monterey 12.6) when I run my test which uses AWS SDK CPP. The crash stack is listed below. It crashes at the Aws::InitAPI() for the first time call. I build SDK by myself. This problem only exists when I linked the SDK static library, not dynamic library. Is it a SDK bug? --crash stack
--my code
--The steps I used to build AWS SDK. If I set -DBUILD_SHARED_LIBS to "ON", there is no any problem for my test.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I have figured out it is my problem. I have linked to my dynamic library which links to AWS SDK static libraries, while at the same time my test still links to AWS SDK static libraries. That means I links to AWS SDK static libraries twice. So it causes this problem. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
I have figured out it is my problem. I have linked to my dynamic library which links to AWS SDK static libraries, while at the same time my test still links to AWS SDK static libraries. That means I links to AWS SDK static libraries twice. So it causes this problem.