Skip to content

Compiling on Linux & Mac OS X (vcpkg)

Ranieri Althoff edited this page Jun 5, 2024 · 2 revisions

To download, build, and run The Forgotten Server on Linux or Mac OS X using vcpkg, follow these steps:

Prerequisites

You need the following software installed before proceeding:

  • A Linux or Mac OS X system with a shell (terminal) access.
  • git
  • pkg-config
  • cmake >= 3.19
  • g++ >= 10.5 or clang++ >= 12.0

Step 1: Install vcpkg

  1. Clone the vcpkg repository:
git clone https://github.com/microsoft/vcpkg.git "$HOME/vcpkg"
cd "$HOME/vcpkg"
  1. Bootstrap vcpkg:
./bootstrap-vcpkg.sh
  1. (Optional, but recommended) Integrate vcpkg with your system:
./vcpkg integrate install
  1. Setup environment variables
export VCPKG_ROOT="$HOME/vcpkg"

Step 2: Prepare and build The Forgotten Server

  1. Clone the otland/forgottenserver repository:
git clone https://github.com/otland/forgottenserver.git "$HOME/forgottenserver"
cd "$HOME/forgottenserver"
  1. Run CMake to configure the build:
cmake --preset vcpkg
  1. Build the server:
cmake --build --preset vcpkg --config RelWithDebInfo

Step 3: Run the server

If you already have configured your config.lua file, copy it to the current folder ($HOME/forgottenserver) now. Otherwise, copy config.lua.dist to config.lua (cp config.lua.dist config.lua) and change it to your needs.

To run the server, execute the following:

./build/RelWithDebInfo/tfs

Note: you need a MySQL/MariaDB server running with the configuration set in config.lua, otherwise the server will not start.

Clone this wiki locally