D++ (DPP)
A Lightweight C++ library for Discord
Building on FreeBSD

Building on FreeBSD

1. Toolchain

This project uses CMake. Install it with pkg install cmake

2. Install External Dependencies

Your FreeBSD base system should have all the required dependencies installed by default.

For voice support, additional dependencies are required

pkg install libsodium opus pkgconf

3. Build Source Code

mkdir build
cd build
cmake ..
make -j8

Replace the number after -j with a number suitable for your setup, usually the same as the number of cores on your machine. cmake will fetch any dependencies that are required for you and ensure they are compiled alongside the library.

4. Optional: Run test cases

Run ./test for unit test cases. You will need to create a config.json file in the directory above the executable file with a valid bot token in it. See the example file config.example.json for an example of the correct format.

5. Install globally

make install

6. Installation to a different directory

If you want to install the library, its dependencies and header files to a different directory, specify this directory when running cmake:

cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install

Then once the build is complete, run make install to install to the location you specified.

7. Using the library

Once installed, you can make use of the library in standalone programs simply by including it and linking to it:

clang++ -std=c++17 -ldpp mydppbot.cpp -o dppbot

The important flags in this command-line are:

  • -std=c++17 - Required to compile the headers
  • -ldpp - Link to libdpp.dylib
  • mydppbot.cpp - Your source code
  • dppbot - The name of the executable to make

Of course, this is just a proof of concept - you should really use a more robust build system like `cmake`.

If you are having trouble setting up CMake, you can try our template bot.

Have fun!

D++ Library version 9.0.0D++ Library version v1.0.0D++ Library version v1.0.1D++ Library version v1.0.2D++ Library version v9.0.1D++ Library version v9.0.2D++ Library version v9.0.3D++ Library version v9.0.4D++ Library version v9.0.5D++ Library version v9.0.6D++ Library version v9.0.7D++ Library version v9.0.8D++ Library version v9.0.9