daily-core-sdk is a C/C++ SDK to build native client applications for the
Daily platform.
It supports Linux (x86_64 and aarch64), macOS (x86_64 and aarch64) and
Windows (x86_64).
- A C or C++ compiler: GCC, Clang, Apple Clang or MSVC.
- CMake 3.16 or newer, if you build with CMake.
- On Linux, glibc 2.28 or newer.
- On Windows, Windows 10 or newer.
Download the SDK for your platform from the releases and unpack it. It has:
include/daily_core.h: the C API.include/daily_core_version.h: the SDK version, e.g.DAILY_CORE_VERSION("0.26.1").- The library:
lib/libdaily_core.soon Linux,lib/libdaily_core.dylibon macOS, andbin/daily_core.dllon Windows, which you link withlib/daily_core.dll.lib. cmake/: the CMake package.examples/: example apps.
The library has a C API, so you can use it from C or C++ with any compiler, and it's the only library you link.
Find the package and link to DailyCore::DailyCore:
find_package(DailyCore 0.26 REQUIRED)
target_link_libraries(my_app PRIVATE DailyCore::DailyCore)Then point CMAKE_PREFIX_PATH (or DailyCore_ROOT) to the SDK when you
configure your project:
cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/daily-core-sdkThe version in find_package() is the oldest SDK you need. Newer SDKs with the
same major version are accepted too. You can also check the version in your
code:
#include <daily_core_version.h>
printf("Daily Core %s\n", DAILY_CORE_VERSION);-
Linux and macOS: CMake adds the SDK's
lib/to your app's rpath, so it runs from your build folder. When you install or package your app, ship the library with it and set the rpath, e.g. to$ORIGIN/../libon Linux or@executable_path/../Frameworkson macOS. -
Windows: put
daily_core.dllnext to your app's.exe. It doesn't need the Visual C++ Redistributable. For example, copy it there after building:add_custom_command(TARGET my_app POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:DailyCore::DailyCore> $<TARGET_FILE_DIR:my_app> )
If your project copied cmake/FindDailyCore.cmake and sets DAILY_CORE_PATH,
it keeps working: DAILY_CORE_LIBRARIES is now the shared library, which you
ship with your app (see above). To use the package instead:
- Remove your copy of
FindDailyCore.cmakeand theDAILY_CORE_PATHcheck. - Link to
DailyCore::DailyCoreinstead of usingDAILY_CORE_INCLUDE_DIRSandDAILY_CORE_LIBRARIES. - Remove the system libraries, frameworks and
_ITERATOR_DEBUG_LEVELyou added for Daily Core.
Add include/ to your include path, and link the library:
libdaily_core.so or libdaily_core.dylib with an rpath to find it, or
daily_core.dll.lib on Windows. For example, on Linux:
gcc main.c -I/path/to/daily-core-sdk/include \
-L/path/to/daily-core-sdk/lib -ldaily_core \
-Wl,-rpath,/path/to/daily-core-sdk/lib- c++-audio-mirror: joins a room and sends the audio of the first participant who joins back to the room.
- c++-custom-tracks: sends and receives custom audio tracks.
The examples find the SDK they're in, so you can build them right away:
cd examples/c++-audio-mirror
cmake . -G Ninja -Bbuild -DCMAKE_BUILD_TYPE=Release
ninja -C buildSee each example's README for Windows, cross-compiling and how to run it.