We've built a simple console application that demonstrates how LaunchDarkly's SDK works.
Below, you'll find the basic build procedure, but for more comprehensive instructions, you can visit your Quickstart page or the Server-Side C/C++ SDK reference guide.
-
Download the latest SDK for your platform with
fetch-linux.sh
,fetch-mac.sh
, orfetch-windows.ps1
. -
Edit
hello.c
and set the value ofSDK_KEY
to your LaunchDarkly SDK key. If there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, setFEATURE_FLAG_KEY
to the flag key.
#define SDK_KEY "1234567890abcdef"
#define FEATURE_FLAG_KEY "my-flag"
-
On the command line, run
build-linux.sh
,build-mac.sh
, orbuild-windows.ps1
to build for your platform. -
Run
./hello
You should see the message "Feature flag '<flag key>' is <true/false> for this user"
.