• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Nostalrius Compilation

Ahoi

Active Member
Joined
Sep 23, 2016
Messages
105
Reaction score
30
Hello everyone. According to previous threads here about Nostalrius Compilation, I should follow this tutorial:

Compiling on Windows · otland/forgottenserver Wiki (https://github.com/otland/forgottenserver/wiki/Compiling-on-Windows)

Should I download Visual Studio 2017 Community and vcpkg, or Visual Studio 2015 without vcpkg ?

Compiling on Windows (vcpkg) · otland/forgottenserver Wiki (https://github.com/otland/forgottenserver/wiki/Compiling-on-Windows-%28vcpkg%29)

Which visual studio and which libraries and boost should I use to compile it?

Thanks for answer!
 
Last edited:
You can just use the latest VC, it really doesn't matter. It will just prompt you to upgrade the project.

Should be able to build following that guide

Just do the 64x bit installs, and change the project to Release and x64 in Visual Studio
 
You mean I can compile Nostalrius with Visual Studio 2022 by upgrading the project to v143 with the latest SDK libraries?

I am asking because I tried to use VS2017/2022 and I have problems with compilation, however I don't know if it's because the libraries get mixed up and an error pops up when compiling. So, should I remove all versions and start over with the latest version of VS, latest version of Windows SDK and latest libraries for vcpkg, as I described above?

Additionally, the installation of libraries for vcpkg looks completely different in the newest version than it was in eg TFS 1.2. Does it not matter?
 
Error: Building package mpir:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at Issues · microsoft/vcpkg (https://github.com/Microsoft/vcpkg/issues) including:
Package: mpir:x64-windows

I got error while installing mpir:x64-windows in vcpkg and when I type ./vcpkg update there is nothing to update.
Post automatically merged:

You can just use the latest VC, it really doesn't matter. It will just prompt you to upgrade the project.

Should be able to build following that guide

Just do the 64x bit installs, and change the project to Release and x64 in Visual Studio
Are you sure, you really have compiled succesfully Nostalrius with VS 2022 and the newest VCPKG libraries?
 
Last edited:
Error: Building package mpir:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at Issues · microsoft/vcpkg (https://github.com/Microsoft/vcpkg/issues) including:
Package: mpir:x64-windows

I got error while installing mpir:x64-windows in vcpkg and when I type ./vcpkg update there is nothing to update.
Post automatically merged:


Are you sure, you really have compiled succesfully Nostalrius with VS 2022 and the newest VCPKG libraries?
I use VS 2019 and it works. I have vs 2022 on my work PC, I'll try building from that and let you know.
 
I use VS 2019 and it works. I have vs 2022 on my work PC, I'll try building from that and let you know.
I would be very grateful. Unfortunately, I have a problem installing the mpir package in vcpkg and I have no idea if I am the only one with this problem. I would like to make sure that anyone is able to compile Nostalrius today, in what version of Visual Studio, and what boost libraries do you use for that? The guides are quite old and in this newest one from TFS is guide for VS2022 with newest boost libraries etc.
 
So.. i think I found a solution for that, I tried on "new computer" without any compilator at all.

I followed a tutorial from there:

but i did it that way... (now im copy paste so it might to be to change slash for backslash "./" - ".\" on git command)

on disk i opened "git bash here"
in console
Diff:
git clone https://github.com/Microsoft/vcpkg
then
Code:
cd vcpkg
then
Code:
.\bootstrap-vcpkg.bat
then
Code:
.\vcpkg integrate install
then
Code:
.\vcpkg install --triplet x64-windows boost-iostreams boost-asio boost-system boost-filesystem boost-variant boost-lockfree luajit libmariadb pugixml cryptopp fmt

after that i do
Code:
.\vcpkg install yasm:x64-windows-static
then
Code:
./vcpkg install gmp
then
Code:
./vcpkg install gmp:x64-windows

after that i unziped a new fresh copy of nostalrius from github

in folder vc14 -> theforgotterserver.sln -> UPDATE all VS2022 want!!! SDK etc.. just click OK when he prompr for that

wait for compiler to update all patches (in left down corner You see if he working)
if he done all

in project change to RELEASE and for x64 - then project -> clear ->compile again

when You get lua error -> click on that error it gets you to file with that

C++:
#include <lua.hpp>
to
C++:
#include <luajit/lua.hpp>

it should work - check it and tell me :D
 
friends, I have the following error when trying to compile saberhaven 8.0 on windows, could anyone help? I've tried several methods to solve this but it still doesn't work
 

Attachments

  • image.png.f1c4dc5dc64891cae22fdef96053a518.png
    image.png.f1c4dc5dc64891cae22fdef96053a518.png
    74.8 KB · Views: 10 · VirusTotal
I strongly recommend that you choose to install and configure WSL2, and then build into WSL on Ubuntu 20.04.

Compiling on Ubuntu 20.04

There is a TFS 1.2 server compilation tutorial available on the project page wiki on github. It is possible to compile following the official guide, however, at some point, some errors will occur and need to be fixed. That way, follow the step by step to compile the server without any problems.

Installing Dependencies
It is possible to install all dependencies at once, in a single command, however, I recommend installing them one by one:
Bash:
sudo apt update
sudo apt install git
sudo apt install cmake
sudo apt install build-essential
sudo apt install libluajit-5.1-dev
sudo apt install libmysqlclient-dev
sudo apt install libboost-system-dev
sudo apt install libboost-iostreams-dev
sudo apt install libboost-filesystem-dev
sudo apt install libpugixml-dev
sudo apt install libcrypto++-dev
sudo apt install libfmt-dev
sudo apt install llvm
sudo apt install libmpfr-dev
sudo apt install libgmp-dev
sudo apt install libboost-all-dev
After installing the dependencies, you will need to rename the luajit library directory. To do so, navigate to /usr/include and run the following command:
Bash:
sudo cp -R luajit-2.1 luajit

Cloning the Server Repository
Once the dependencies have been installed, we can clone the Nostalrius project. To do this, just clone the repository via the command line:
Bash:
sudo git clone https://github.com/Ezzz-dev/Nostalrius.git

Compiling the Server
First, navigate to the cloned repository:
Bash:
cd Nostalrius-master
Now, let's create the folder that cmake will use to compile the server:
Bash:
sudo mkdir build
cd build
sudo cmake ..
If everything happens without any errors, the server is ready to be compiled. To compile, just run the command:
Bash:
sudo make
If everything goes as expected and the build is successful, an executable named tfs will be created inside the build folder. In order to be able to run the server, the tfs file must be copied out of the build folder, making it available in the root of the server:
Bash:
sudo cp tfs ../tfs
Once this is done, the server will be ready to run.

Why i recommend you to do this way? Because you can use it with docker and it will always work... You will not have to mantain different visual studio versions, and manage lot of versions and packges all together and installed on your windows. The best thing is: when you deploy your server on some cloud machine, you can use this same way to do in a linux cloud machine.
 
Last edited:
So.. i think I found a solution for that, I tried on "new computer" without any compilator at all.

I followed a tutorial from there:

but i did it that way... (now im copy paste so it might to be to change slash for backslash "./" - ".\" on git command)

on disk i opened "git bash here"
in console
Diff:
git clone https://github.com/Microsoft/vcpkg
then
Code:
cd vcpkg
then
Code:
.\bootstrap-vcpkg.bat
then
Code:
.\vcpkg integrate install
then
Code:
.\vcpkg install --triplet x64-windows boost-iostreams boost-asio boost-system boost-filesystem boost-variant boost-lockfree luajit libmariadb pugixml cryptopp fmt

after that i do
Code:
.\vcpkg install yasm:x64-windows-static
then
Code:
./vcpkg install gmp
then
Code:
./vcpkg install gmp:x64-windows

after that i unziped a new fresh copy of nostalrius from github

in folder vc14 -> theforgotterserver.sln -> UPDATE all VS2022 want!!! SDK etc.. just click OK when he prompr for that

wait for compiler to update all patches (in left down corner You see if he working)
if he done all

in project change to RELEASE and for x64 - then project -> clear ->compile again

when You get lua error -> click on that error it gets you to file with that

C++:
#include <lua.hpp>
to
C++:
#include <luajit/lua.hpp>

it should work - check it and tell me :D


It worked. It needed some adjustments to my nostalrius fork, but everything worked fine.
Thanks!
 
Back
Top