One of MantisBase’s biggest goals has always been embeddability in any C++ codebase. In the past, you had to compile MantisBase from source, and if you’ve tried, you know it can be daunting.
Our biggest v0.4.x goal was shipping a dev package with shared libraries and header files, so you don’t have to build from source if dynamic linking works for you.
This is part one of a two-part series: this post walks you through how to acquire and set up a MantisBase dev package. Part two will cover actually integrating it into your application.
Which version
From v0.4.0, we shipped a dev package, mantisbase_v0.4.0-dev.zip, with both static and shared libs plus header files. Unfortunately, the symbols weren’t exported correctly, which made most of it unusable.
That’s fixed as of the beta release v0.4.5, and we’ve also split the dev package by platform: mantisbase_v0.4.5-[linux/windows]-cpp-dev.zip. See the release page.
From this release onward, all necessary symbols are exported correctly. We no longer ship static libs for now; if you have a specific need for a static build, let us know!
Getting the dev package
Download the dev package for your platform (Linux or Windows) from the GitHub Releases page and unzip it to your desired directory.
Note: Header files for Windows and Linux are platform-specific, so they may not be 100% cross-usable.
The unzipped directory structure looks like this:
README.md quick readme file
VERSION release tag
include/ header tree for this OS (mantisbase headers + bundled
third-party headers: drogon, trantor, nlohmann/json,
jsoncpp, soci, spdlog, fmt, dukglue, duktape, wolfssl, ...)
libs/
x86/ prebuilt shared library for x86-64 (libmantisbase.so) — Linux only
arm/ prebuilt shared library for aarch64 (libmantisbase.so) — Linux only
(Windows ships x86_64 only, under libs/x86/)
cmake/
MantisBaseConfig.cmake find_package(MantisBase) entry point
MantisBaseConfigVersion.cmake version matching
On Linux, there are additional system prerequisites required at build and run time. Install them with:
sudo apt-get update
sudo apt-get install -y libpq-dev uuid-devRuntime shared libraries on Debian/Ubuntu are libpq5 and libuuid1.
Windows requires no additional system dependencies to build or run against the dev package.
Quick CMake integration
This example assumes Linux; the workflow is similar for Windows with the Windows dev package.
First, create an empty CMake-based project (via an IDE or any means you prefer). Copy the unzipped dev package into the project, e.g., into mantisbase-linux-cpp-dev/. The resulting directory structure looks like this:
CMakeLists.txt application CMake file
main.cpp application entry point
mantisbase-linux-cpp-dev/ same folder structure as before
README.md
VERSION
include/
libs/
x86/
arm/
cmake/
MantisBaseConfig.cmake
MantisBaseConfigVersion.cmakePoint CMake at the package with find_package:
cmake_minimum_required(VERSION 3.22)
project(my_app)
set(MantisBase_DIR "/path/to/mantisbase-linux-cpp-dev/cmake")
find_package(MantisBase REQUIRED)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE mantisbase::shared)
main.cpp:
#include <mantisbase/mantisbase.h>
int main(int argc, char* argv[])
{
auto app = mb::MantisBase::create(argc, argv);
return app->run();
}Help
Coming up in part two: actually wiring MantisBase into your application: configuration, plugins, and extension points.



