• 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!

Compiling tfs 1.5 downgraded Problem Boost..

Lana613

New Member
Joined
Jan 23, 2025
Messages
19
Reaction score
4
xxxxx.webp
Czy ktoś może mi z tym pomóc?

edit:
This helped me

sudo apt install libboost-filesystem-dev


but when I type make
this crashes during compilation

[ 57%] Building CXX object CMakeFiles/tfs.dir/src/otserv.cpp.o
[ 59%] Building CXX object CMakeFiles/tfs.dir/src/outfit.cpp.o
[ 60%] Building CXX object CMakeFiles/tfs.dir/src/outputmessage.cpp.o
In file included from /usr/include/c++/14/ext/alloc_traits.h:34,
from /usr/include/c++/14/bits/forward_list.h:41,
from /usr/include/c++/14/forward_list:40,
 

Attachments

Last edited:
Check:
LUA:
sudo apt update
sudo apt install libboost-all-dev
Try running CMake again.
If the problem persists:
Manually enter the path to Boost
Code:
cmake .. -DBOOST_ROOT=/usr/include/boost -DBoost_NO_BOOST_CMAKE=ON
Try installing the necessary packages:
Code:
sudo apt install libboost-filesystem-dev

Final Option – Manually Compile Boost:
Code:
wget https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz
tar -xvzf boost_1_83_0.tar.gz
cd boost_1_83_0
./bootstrap.sh --prefix=/usr/local
./b2 install
Code:
cmake .. -DBOOST_ROOT=/usr/local


Compilation:
Add rebind<U> to the LockfreePoolingAllocator class to meet the allocator requirements:
LUA:
template <typename U> struct rebind { using other = LockfreePoolingAllocator<U, 2048>; };
Replace allocate_shared with make_shared:
Code:
auto msg = std::allocate_shared<OutputMessage>(LockfreePoolingAllocator<void, 2048>());
On
Code:
auto msg = std::make_shared<OutputMessage>();

These are probable solutions, I could be wrong. I'm learning myself.
 
Last edited:
LUA:
sudo apt-get update
sudo apt-get install gzip
Post automatically merged:

I'm sorry, but I'm not that knowledgeable and I'll ask, which file should I change this in?
In the console you have written where to search. You have the file name and path position.
Remember to make copies of your files!
 
Last edited:
problem..


LUA:
[  1%] Building CXX object CMakeFiles/tfs.dir/src/outputmessage.cpp.o
In file included from /usr/include/c++/14/bits/stl_tempbuf.h:61,
                 from /usr/include/c++/14/bits/stl_algo.h:69,
                 from /usr/include/c++/14/algorithm:61,
                 from /home/ubuntu/TFS-1.5-Downgrades-8.60/src/otpch.h:25,
                 from /home/ubuntu/TFS-1.5-Downgrades-8.60/build/CMakeFiles/tfs.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/c++/14/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_Tp*, _Args&& ...) [with _Tp = OutputMessage; _Args = {LockfreePoolingAllocator<void, 2048>}]’:
/usr/include/c++/14/bits/alloc_traits.h:657:19:   required from ‘static void std::allocator_traits<std::allocator<void> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = OutputMessage; _Args = {LockfreePoolingAllocator<void, 2048>}; allocator_type = std::allocator<void>]’
  657 |         { std::_Construct(__p, std::forward<_Args>(__args)...); }
      |           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_base.h:607:39:   required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {LockfreePoolingAllocator<void, 2048>}; _Tp = OutputMessage; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
  607 |           allocator_traits<_Alloc>::construct(__a, _M_ptr(),
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
  608 |               std::forward<_Args>(__args)...); // might throw
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_base.h:969:16:   required from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = OutputMessage; _Alloc = std::allocator<void>; _Args = {LockfreePoolingAllocator<void, 2048>}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
  969 |           auto __pi = ::new (__mem)
      |                       ^~~~~~~~~~~~~
  970 |             _Sp_cp_type(__a._M_a, std::forward<_Args>(__args)...);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_base.h:1713:14:   required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {LockfreePoolingAllocator<void, 2048>}; _Tp = OutputMessage; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
 1713 |         : _M_ptr(), _M_refcount(_M_ptr, __tag, std::forward<_Args>(__args)...)
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:463:59:   required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {LockfreePoolingAllocator<void, 2048>}; _Tp = OutputMessage]’
  463 |         : __shared_ptr<_Tp>(__tag, std::forward<_Args>(__args)...)
      |                                                                  ^
/usr/include/c++/14/bits/shared_ptr.h:1007:14:   required from ‘std::shared_ptr<typename std::enable_if<(! std::is_array<_Tp>::value), _Tp>::type> std::make_shared(_Args&& ...) [with _Tp = OutputMessage; _Args = {LockfreePoolingAllocator<void, 2048>}; typename enable_if<(! is_array<_Tp>::value), _Tp>::type = OutputMessage]’
 1007 |       return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{__a},
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1008 |                              std::forward<_Args>(__args)...);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/TFS-1.5-Downgrades-8.60/src/outputmessage.cpp:81:40:   required from here
   81 |         return std::make_shared<OutputMessage>(LockfreePoolingAllocator<void, OUTPUTMESSAGE_FREE_LIST_CAPACITY>());
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_construct.h:119:7: error: no matching function for call to ‘OutputMessage::OutputMessage(LockfreePoolingAllocator<void, 2048>)’
  119 |       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ubuntu/TFS-1.5-Downgrades-8.60/src/outputmessage.cpp:22:
/home/ubuntu/TFS-1.5-Downgrades-8.60/src/outputmessage.h:32:17: note: candidate: ‘OutputMessage::OutputMessage()’
   32 |                 OutputMessage() = default;
      |                 ^~~~~~~~~~~~~
/home/ubuntu/TFS-1.5-Downgrades-8.60/src/outputmessage.h:32:17: note:   candidate expects 0 arguments, 1 provided
make[2]: *** [CMakeFiles/tfs.dir/build.make:781: CMakeFiles/tfs.dir/src/outputmessage.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/tfs.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
root@damian:/home/ubuntu/TFS-1.5-Downgrades-8.60/build#

i change outputmessage.cpp
line 81
Code:
    return std::make_shared<OutputMessage>(LockfreePoolingAllocator<void, OUTPUTMESSAGE_FREE_LIST_CAPACITY>());
Post automatically merged:

Can anyone help me with this? Will reinstalling the system help?
 
Last edited:
I can't go to the next stage because I can't find mysql. it is generally installed in /etc/mysql
please help

Thank you

1740482347514.webp


root@damian:/home/ubuntu/TFS-1.5-Downgrades-8.60/build# cmake ..
CMake Error at cmake/FindMySQL.cmake:123 (MESSAGE):
Cannot find MySQL. Include dir: /usr/local library dir:
Call Stack (most recent call first):
CMakeLists.txt:34 (find_package)


-- Configuring incomplete, errors occurred!
 
I can't go to the next stage because I can't find mysql. it is generally installed in /etc/mysql
You must install MySQL C++ library:
Code:
sudo apt install libmysqlclient-dev
All libraries required by TFS 1.6:
Code:
sudo apt install git cmake build-essential libluajit-5.1-dev libmysqlclient-dev libboost-all-dev libpugixml-dev libcrypto++-dev libfmt-dev

If you still got problem, post:
  • where did you download this engine (official github?)
  • what tibia protocol you are using (7.72, 8.0 or 8.6)
  • what linux is it (it's ubuntu, but 20/22/24?)
 
Ooo thanks!

Linux
UBUNTU 24.04, protocol 8.60 downgraded
  • where did you download this engine (official github?) - Yes


CMake Warning (dev) at CMakeLists.txt:55 (find_package):
Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake
--help-policy CMP0167" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable version "1.83.0", minimum required is "1.66.0") found components: date_time system filesystem iostreams
-- IPO / LTO enabled
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/ubuntu/TFS-1.5-Downgrades-8.60/build






and crash

1740484569289.webp
 


LUA:
root@damian:/home/ubuntu/TFS-1.5-Downgrades-8.60/build# make
[  1%] Building CXX object CMakeFiles/tfs.dir/src/outputmessage.cpp.o
In file included from /usr/include/c++/14/ext/alloc_traits.h:34,
                 from /usr/include/c++/14/bits/forward_list.h:41,
                 from /usr/include/c++/14/forward_list:40,
                 from /home/ubuntu/TFS-1.5-Downgrades-8.60/src/otpch.h:28,
                 from /home/ubuntu/TFS-1.5-Downgrades-8.60/build/CMakeFiles/tfs.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/c++/14/bits/alloc_traits.h: In instantiation of ‘struct std::__allocator_traits_base::__rebind<LockfreePoolingAllocator<void, 2048>, std::_Sp_counted_ptr_inplace<OutputMessage, LockfreePoolingAllocator<void, 2048>, __gnu_cxx::_S_atomic>, void>’:
/usr/include/c++/14/bits/alloc_traits.h:95:11:   required by substitution of ‘template<class _Alloc, class _Up> using std::__alloc_rebind = typename std::__allocator_traits_base::__rebind<_Alloc, _Up>::type [with _Alloc = LockfreePoolingAllocator<void, 2048>; _Up = std::_Sp_counted_ptr_inplace<OutputMessage, LockfreePoolingAllocator<void, 2048>, __gnu_cxx::_S_atomic>]’
   95 |     using __alloc_rebind
      |           ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_base.h:598:13:   required from ‘class std::_Sp_counted_ptr_inplace<OutputMessage, LockfreePoolingAllocator<void, 2048>, __gnu_cxx::_S_atomic>’
  598 |       using __allocator_type = __alloc_rebind<_Alloc, _Sp_counted_ptr_inplace>;
      |             ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_base.h:966:43:   required from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = OutputMessage; _Alloc = LockfreePoolingAllocator<void, 2048>; _Args = {}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
  966 |           typename _Sp_cp_type::__allocator_type __a2(__a._M_a);
      |                                                  ^~~~
/usr/include/c++/14/bits/shared_ptr_base.h:1713:14:   required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = LockfreePoolingAllocator<void, 2048>; _Args = {}; _Tp = OutputMessage; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
 1713 |         : _M_ptr(), _M_refcount(_M_ptr, __tag, std::forward<_Args>(__args)...)
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:463:59:   required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = LockfreePoolingAllocator<void, 2048>; _Args = {}; _Tp = OutputMessage]’
  463 |         : __shared_ptr<_Tp>(__tag, std::forward<_Args>(__args)...)
      |                                                                  ^
/usr/include/c++/14/bits/shared_ptr.h:990:14:   required from ‘std::shared_ptr<typename std::enable_if<(! std::is_array<_Tp>::value), _Tp>::type> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = OutputMessage; _Alloc = LockfreePoolingAllocator<void, 2048>; _Args = {}; typename enable_if<(! is_array<_Tp>::value), _Tp>::type = OutputMessage]’
  990 |       return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{__a},
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  991 |                              std::forward<_Args>(__args)...);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/TFS-1.5-Downgrades-8.60/src/outputmessage.cpp:81:44:   required from here
   81 |         return std::allocate_shared<OutputMessage>(LockfreePoolingAllocator<void, OUTPUTMESSAGE_FREE_LIST_CAPACITY>());
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/alloc_traits.h:71:31: error: static assertion failed: allocator_traits<A>::rebind_alloc<A::value_type> must be A
   71 |                         _Tp>::value,
      |                               ^~~~~
/usr/include/c++/14/bits/alloc_traits.h:71:31: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
make[2]: *** [CMakeFiles/tfs.dir/build.make:784: CMakeFiles/tfs.dir/src/outputmessage.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:112: CMakeFiles/tfs.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
 
Last edited:
required by substitution of ‘template
To fix this, replace your src/lockfree.h with newest TFS one:

You must add small modification in newest TFS file to make it work with Nekiro.
Under:
C++:
#define FS_LOCKFREE_H
add:
C++:
#include <boost/lockfree/stack.hpp>

EDIT:
My tested lockfree.h code for Nekiro (it's TFS 1.4 file https://raw.githubusercontent.com/otland/forgottenserver/refs/heads/1.4/src/lockfree.h ):

It compiles on Ubuntu 24.04 with instruction:
Code:
apt update
apt install -yq cmake build-essential ninja-build libcrypto++-dev libfmt-dev liblua5.4-dev libluajit-5.1-dev libmysqlclient-dev libboost-iostreams-dev libboost-locale-dev libboost-system-dev libpugixml-dev libboost-filesystem-dev

mkdir build
cd build
cmake ..
make -j$(nproc)
Dockerfile example:
Code:
FROM ubuntu:24.04

RUN apt update && \
apt install -yq cmake build-essential ninja-build \
libcrypto++-dev libfmt-dev liblua5.4-dev libluajit-5.1-dev libmysqlclient-dev \
    libboost-iostreams-dev libboost-locale-dev libboost-system-dev libpugixml-dev libboost-filesystem-dev

COPY cmake /usr/src/forgottenserver/cmake/
COPY src /usr/src/forgottenserver/src/
COPY CMakeLists.txt /usr/src/forgottenserver/

RUN mkdir build

WORKDIR /usr/src/forgottenserver/build
RUN cmake .. && make -j$(nproc)
 
Last edited:
Check:
LUA:
sudo apt update
sudo apt install libboost-all-dev
Try running CMake again.
If the problem persists:
Manually enter the path to Boost
Code:
cmake .. -DBOOST_ROOT=/usr/include/boost -DBoost_NO_BOOST_CMAKE=ON
Try installing the necessary packages:
Code:
sudo apt install libboost-filesystem-dev

Final Option – Manually Compile Boost:
Code:
wget https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz
tar -xvzf boost_1_83_0.tar.gz
cd boost_1_83_0
./bootstrap.sh --prefix=/usr/local
./b2 install
Code:
cmake .. -DBOOST_ROOT=/usr/local


Compilation:
Add rebind<U> to the LockfreePoolingAllocator class to meet the allocator requirements:
LUA:
template <typename U> struct rebind { using other = LockfreePoolingAllocator<U, 2048>; };
Replace allocate_shared with make_shared:
Code:
auto msg = std::allocate_shared<OutputMessage>(LockfreePoolingAllocator<void, 2048>());
On
Code:
auto msg = std::make_shared<OutputMessage>();

These are probable solutions, I could be wrong. I'm learning myself.


It went on after application
auto msg = std::make_shared&lt;OutputMessage&gt;();

this is probably the last one xd

Bez nazwy.webp
 
this is probably the last one xd
It's just a warning. You can ignore it. Engine is compiled, you can copy tfs file from build directory to main OTS directory (mv tfs ../tfs) and run it (./tfs).

It you want to have clean build (fix this warning), you can replace in src/tools.cpp 368 line:
C++:
char buffer[20];
with:
C++:
char buffer[75];
 
Back
Top