{ "support_level": "production", "type": "language", "name": "Native (C/C++)", "doc_link": "https://docs.sentry.io/error-reporting/quickstart/?platform=native", "body": "

Install the SDK by downloading the latest\nrelease. Next, follow the\ninstructions in the Native SDK Documentation to build and link the SDK\nlibrary.

\n\n \n\n\n\n\n

Import and initialize the Sentry SDK early in your application setup:

\n\n
#include <sentry.h>\n\nint main(void) {\n  sentry_options_t *options = sentry_options_new();\n  sentry_options_set_dsn(options, \"___PUBLIC_DSN___\");\n  sentry_init(options);\n\n  /* ... */\n\n  // make sure everything flushes\n  sentry_shutdown();\n}\n
\n\n

Alternatively, the DSN can be passed as SENTRY_DSN environment variable during\nruntime. This can be especially useful for server applications.

\n\n \n\n\n\n

The quickest way to verify Sentry in your Native application is by capturing a message:

\n\n
sentry_capture_event(sentry_value_new_message_event(\n  /*   level */ SENTRY_LEVEL_INFO,\n  /*  logger */ \"custom\",\n  /* message */ \"It works!\",\n));\n
" }