Getting Started

Compiling libdiscord for Windows

You should be able to simply download this git repository and open up the .sln file and build it after installing some dependencies.

The solution was made in Visual Studio 2015 and has the following dependencies:

CPPRestSDK You can install this as a Nuget package.

ZLib You can install this as a Nuget package.

After installing these dependencies you should be able to compile the libdiscord project.

Compiling a Bot on Windows

To compile a bot on Windows you must have libdiscord.lib and the libdiscord include directory in your path. If using Visual Studio, simply add them to your project settings. After your project is set up, you must include the discord.h header file to access the library.

Compiling libdiscord for Linux

The git project has a very simple makefile, so you should be able to just use make in the root directory. However, you will need to have CPPRestSDK and its dependencies installed. Visit this link to learn how to install it.

Here is a list of all the libraries you must have installed:

boost_system

cpprest

crypto

pthread

ssl

z

The command that you should run is make && sudo make install. This will build libdiscord.so into the lib directory (Create this if it's missing), and the install command will place the resulting library into /usr/lib/libdiscord.so. From there, your programs should be able to compile using this library.

Compiling a Bot on Linux

This is a bit more involved than Windows simply because I don't know if you can combine shared libraries easily. Assuming you have a project with a single main.cpp file, you would compile it like so:

In here, you should be using the -I flag to point to the libdiscord includes. After that, you must include -ldiscord for this library, and then link it against all its dependencies as well. This is a bit more than I would like for a simple program, so I'll try to look into simplifying it later.