Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux linking errors #1079

Open
pierricgimmig opened this issue Nov 12, 2024 · 1 comment
Open

Linux linking errors #1079

pierricgimmig opened this issue Nov 12, 2024 · 1 comment

Comments

@pierricgimmig
Copy link

On Linux, I get:

git/sentry-native/src/backends/sentry_backend_crashpad.cpp:55: undefined reference to operator delete(void*, unsigned long)'`

What fixed it for me was to link with stdc++:

CMakeLists.txt

-       set(_SENTRY_PLATFORM_LIBS "dl" "rt")
+       set(_SENTRY_PLATFORM_LIBS "dl" "rt" "stdc++")

external/crashpad/handler/CMakeLists.txt

diff --git a/handler/CMakeLists.txt b/handler/CMakeLists.txt
index b7ba49ec..c60e3ada 100644
--- a/handler/CMakeLists.txt
+++ b/handler/CMakeLists.txt
@@ -107,6 +107,7 @@ if(NOT IOS)
             crashpad_tools
             crashpad_util
             mini_chromium
+            stdc++
     )

@supervacuus
Copy link
Collaborator

Thanks for the report! We're building the Native SDK on many Linux setups and haven't had a situation where we need to specify a particular stdlib implementation (except if someone is required to use a specific implementation over an environmental default).

This is typically defined via your toolchain, and we'd love to keep the toolchain-preferred stdlib (as we do now) instead of enforcing libstdc++ for everyone (since that can lead to non-obvious behavior in toolchains that have other default stdlibs like libc++).

Can you provide more context on which setup (Linux distribution, toolchain packages, CMake config-phase output) you had to specify a C++ standard library? I know that some "embedded" toolchains require further specification (in which case, I recommend preparing a simple CMake toolchain file that includes everything you need).

@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Nov 18, 2024
@kahest kahest moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Status: Needs More Information
Development

No branches or pull requests

3 participants