launchdarkly / cpp-sdks

C++ Client/Server SDKs
Other
5 stars 2 forks source link

hello-cpp-client cannot build because of hidden symbols #411

Open PunChaFeng opened 2 months ago

PunChaFeng commented 2 months ago

Is this a support request? No.

Describe the bug Building hello-cpp-client with the shared C++ client library results in linking errors (Undefined symbols). I think it is because all the C++ symbols are hidden.

To reproduce

cwaldren-ld commented 2 months ago

Hi @PunChaFeng , this is intentional.

We don't officially support consuming the C++ SDK as a shared library because we can't guarantee the symbols + ABI will remain stable. Specifically, if our release process causes an ABI change, we don't want to break any users who are consuming the built libraries.

In contrast, we do support using the C bindings in shared library.

But, I think it is fair that we could add a CMake option to enable this for people who can guarantee that the same build system is used for the shared libraries and their application.

Is that true for your use-case?

PunChaFeng commented 2 months ago

@cwaldren-ld Thank you for your detailed explanation. Your insights about the C++ SDK and the C bindings have helped me understand your intentions. I appreciate your suggestion about the CMake option, and yes, it would work for my use case.

cwaldren-ld commented 2 months ago

Ok, I cannot promise any timeline but your request has been noted.

I will notify you if this is released.

Filed internally as 246572.

puncha commented 1 month ago

@cwaldren-ld Thank you. I created a PR to address this issue. Could you please review it?