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

[C++/Linux] Compiling old engine (sources) on Debian 10 / Ubuntu 20.04

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
There are many threads with compilation errors, but I did not find any with full instruction how to fix all problems.

For people familiar with 'git compare':
1)
All errors fixed one by one: gesior/tfs_0.4_on_debian_10 (https://github.com/gesior/tfs_0.4_on_debian_10/commits/main)
2) Total diff of TFS 0.4 rev 3777 update to compile it on Debian 10: gesior/tfs_0.4_on_debian_10 (https://github.com/gesior/tfs_0.4_on_debian_10/compare/c215d09...9664f12)

TFS 0.4 rev 3777 sources updated to compile on Debian 10: gesior/tfs_0.4_on_debian_10 (https://github.com/gesior/tfs_0.4_on_debian_10)

Packages required to compile old engines on Debian 10:
Code:
apt install libboost-all-dev libgmp3-dev liblua5.1-0 liblua5.1-0-dev  lua5.1 libxml2-dev libxml++2.6-dev zlib1g-dev zlib1g libcrypto++-dev libcrypto++6 libssl-dev libmariadb-dev libmariadb-dev-compat cpp gcc g++ make autoconf

TFS 0.4 commands to compile on Debian 10:
Code:
sh autogen.sh
./configure --enable-mysql --disable-dependency-tracking
sh build.sh

Step by step error fixing instruction:
0)
Get some program to search in all files in 'sources' directory, like Notepad++/Sublime Text, some IDE or in case of linux terminal "grep -R"
1) Error:
Code:
checking boost/tr1/unordered_set.hpp usability... no
checking boost/tr1/unordered_set.hpp presence... no
checking for boost/tr1/unordered_set.hpp... no
configure: error: "boost::unordered_set header not found."
Search in all files in 'sources' directory.
Replace every:
Code:
/tr1/
with:
Code:
/
Replace every:
Code:
std::tr1::
with:
Code:
boost::

2) Error:
Code:
chat.cpp: In member function ‘ChatChannel* Chat::getChannel(Player*, uint16_t)’:
chat.cpp:1144:10: error: cannot convert ‘bool’ to ‘ChatChannel*’ in return
1144 |   return false;
replace at 1144 line - it's in function "ChatChannel* Chat::getChannel(Player*, uint16_t)" - of chat.cpp:
Code:
return false;
with:
Code:
return NULL;

3) Error:
Code:
connection.cpp: In member function ‘void Connection::accept()’:
connection.cpp:323:82: error: no matching function for call to ‘boost::posix_time::seconds::seconds(Connection::<unnamed enum>)’
  323 |   m_readTimer.expires_from_now(boost::posix_time::seconds(Connection::readTimeout));
...
(it throws around 100 lines of errors)
In connection.cpp and connection.h - some searches may return 0 results, it's fine.
Replace every:
Code:
Connection::readTimeout
with:
Code:
CONNECTION_READ_TIMEOUT
Replace every:
Code:
Connection::writeTimeout
with:
Code:
CONNECTION_WRITE_TIMEOUT
Replace every:
Code:
Connection::read_timeout
with:
Code:
CONNECTION_READ_TIMEOUT
Replace every:
Code:
Connection::write_timeout
with:
Code:
CONNECTION_WRITE_TIMEOUT
in connection.h remove:
Code:
enum {writeTimeout = 30};
enum {readTimeout = 30};
in connection.h above:
Code:
class Protocol;
add:
Code:
static constexpr int32_t CONNECTION_WRITE_TIMEOUT = 30;
static constexpr int32_t CONNECTION_READ_TIMEOUT = 30;

4) Error:
Code:
game.cpp: In member function ‘Item* Game::findItemOfType(Cylinder*, uint16_t, bool, int32_t)’:
game.cpp:1725:10: error: cannot convert ‘bool’ to ‘Item*’ in return
1725 |   return false;
replace at 1725 line - it's in function "Item* Game::findItemOfType(Cylinder*, uint16_t, bool, int32_t)" - of game.cpp:
Code:
return false;
with:
Code:
return NULL;

5) Error:
Code:
luascript.cpp: In member function ‘bool LuaInterface::loadDirectory(const string&, Npc*)’:
luascript.cpp:741:23: error: ‘class boost::filesystem::directory_entry’ has no member named ‘leaf’
  741 |   std::string s = it->leaf();
In luascript.cpp replace every:
Code:
->leaf()
with:
Code:
->path().filename().string()

6) Error:
Code:
protocolgame.cpp: In member function ‘virtual void ProtocolGame::parsePacket(NetworkMessage&)’:
protocolgame.cpp:826:54: error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’ and ‘std::stringstream’ {aka ‘std::__cxx11::basic_stringstream<char>’})
  826 |     s << player->getName() << " sent unknown byte: " << hex << std::endl;
or:
Code:
protocolgame.cpp:955:28: error: cannot bind ‘std::basic_ostream<char>’ lvalue to ‘std::basic_ostream<char>&&’
s << player->getName() << " sent unknown byte: " << hex << std::endl;
In protocolgame.cpp replace:
Code:
s << player->getName() << " sent unknown byte: " << hex << std::endl;
with:
Code:
s << player->getName() << " sent unknown byte: " << hex.str() << std::endl;

7) Error:
Code:
scriptmanager.cpp: In member function ‘bool ScriptManager::loadMods()’:
scriptmanager.cpp:130:23: error: ‘class boost::filesystem::directory_entry’ has no member named ‘leaf’
  130 |   std::string s = it->leaf();
In scriptmanager.cpp replace every:
Code:
->leaf()
with:
Code:
->path().filename().string()

8) Error:
Code:
talkaction.cpp: In member function ‘bool TalkActions::onPlayerSay(Creature*, uint16_t, const string&, bool)’:
talkaction.cpp:137:37: error: array must be initialized with a brace-enclosed initializer
  137 |  std::string cmd[TALKFILTER_LAST] = words, param[TALKFILTER_LAST] = "";
      |                                     ^~~~~
talkaction.cpp:137:69: error: array must be initialized with a brace-enclosed initializer
  137 |  std::string cmd[TALKFILTER_LAST] = words, param[TALKFILTER_LAST] = "";
In talkaction.cpp replace:
Code:
std::string cmd[TALKFILTER_LAST] = words, param[TALKFILTER_LAST] = "";
with:
Code:
std::string cmd[TALKFILTER_LAST] = {words, words, words}, param[TALKFILTER_LAST] = {"", "", ""};

9) Error at end of compilation:
Code:
/usr/bin/ld: connection.o: undefined reference to symbol '[email protected]@GLIBC_2.3.3'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
In configure.ac replace:
Code:
LIBS="$LIBS $XML_LIBS"
with:
Code:
LIBS="$LIBS $XML_LIBS -lpthread"

10) Random C++ errors - warnings handled as errors, because of configuration.
Before you start searching on forum, why it does not compile, edit file makefile.am:
Search and remove:
Code:
-Wall
Code:
-Werror
Code:
-Wextra

11) Error at end of compilation:
Code:
configmanager.cpp:(.text+0x181): undefined reference to `lua_getglobal'
/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `(anonymous namespace)::getGlobalBoolean(lua_State*, char const*, bool)':
configmanager.cpp:(.text+0x1fc): undefined reference to `lua_getglobal'
(...)
/usr/bin/ld: CMakeFiles/tfs.dir/src/databasemanager.cpp.o: in function `DatabaseManager::updateDatabase()':
databasemanager.cpp:(.text+0x98c): undefined reference to `lua_setglobal'
Install LuaJIT:
Code:
apt install libluajit-5.1-dev
Replace cmake/FindLuaJIT.cmake file with newest TFS one:
https://github.com/otland/forgottenserver/blob/master/cmake/FindLuaJIT.cmake

12) Error:
Code:
databasemysql.cpp: In constructor ‘DatabaseMySQL::DatabaseMySQL()’:
databasemysql.cpp:47:2: error: ‘my_bool’ was not declared in this scope; did you mean ‘bool’?
   47 |  my_bool reconnect = true;
Replace in databasemysql.cpp:
Code:
my_bool reconnect = true;
With:
Code:
bool reconnect = true;

13) Error:
Code:
otserv.cpp: In function ‘void otserv(StringVec, ServiceManager*)’:
otserv.cpp:599:18: error: invalid use of incomplete type ‘RSA’ {aka ‘struct rsa_st’}
  BN_dec2bn(&g_RSA->p, g_config.getString(ConfigManager::RSA_PRIME1).c_str());
                  ^~
In file included from /usr/include/openssl/crypto.h:25,
                 from /usr/include/openssl/bio.h:20,
                 from /usr/include/openssl/asn1.h:16,
                 from /usr/include/openssl/rsa.h:16,
                 from otserv.cpp:44:
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA’ {aka ‘struct rsa_st’}
typedef struct rsa_st RSA;
You must replace outdated OpenSSL library with Crypto++ and GMP libraries.
Example of replacing libraries and algorithms RSA, MD5, SHA1, SHA256, SHA512 with RSA and SHA1 (other algorithms removed) in OTX2 engine:

14) Error:
Code:
talkaction.cpp:248:15: note:   ‘std::__cxx11::basic_stringstream<char>’ is not derived from ‘std::_Setfill<_CharT>’
  248 |         ss << sl << "...";
 
talkaction.cpp:248:15: note:   cannot convert ‘sl’ (type ‘std::stringstream’ {aka ‘std::__cxx11::basic_stringstream<char>’}) to type ‘std::_Setprecision’
  248 |         ss << sl << "...";

talkaction.cpp:247:15: error: cannot bind ‘std::basic_ostream<char>’ lvalue to ‘std::basic_ostream<char>&&’
         ss << sl << "...";
Replace in talkaction.cpp:
Code:
ss << sl << "...";
With:
Code:
ss << sl.str() << "...";

15) Error:
Code:
‘lexical_cast’ is not a member of ‘boost’

creatureevent.cpp: In member function ‘bool CreatureEvents::playerLogout(Player*, bool)’:
creatureevent.cpp:146:38: error: ‘lexical_cast’ is not a member of ‘boost’
   player->setStorage(expPots, boost::lexical_cast<std::string>(expPotCharges));
                                      ^~~~~~~~~~~~
creatureevent.cpp:146:38: note: suggested alternative: ‘numeric_cast’
   player->setStorage(expPots, boost::lexical_cast<std::string>(expPotCharges));
                                      ^~~~~~~~~~~~
                                      numeric_cast
creatureevent.cpp:146:62: error: expected primary-expression before ‘>’ token
   player->setStorage(expPots, boost::lexical_cast<std::string>(expPotCharges));
At top of file - in this case creatureevent.cpp , but it can be reported in other files too - add:
Code:
#include <boost/lexical_cast.hpp>

To apply all changes, you MUST run all 3 commands again:
Code:
sh autogen.sh
./configure --enable-mysql --disable-dependency-tracking
sh build.sh

If you get any compilation error not listed above, post it in this thread.
(only problems with compiling old OTS engines on Debian 9 / 10 and Ubuntu 20.04)

You can also send errors to me by Discord: Gesior.pl#3208
 
Last edited:

gunz

GunzOT Owner
Premium User
Joined
Dec 30, 2007
Messages
517
Solutions
5
Reaction score
173
I would recommend to use Docker-based solution with older version of Debian container.
 

Perwers

NNStory Dev.
Joined
Jul 6, 2016
Messages
52
Solutions
7
Reaction score
26
Location
Poland
Debian 9 [10 too?]
Disabling boost 1.73 warnings;

otpch.h
above
Code:
#ifdef __OTPCH__
add
Code:
#define BOOST_BIND_NO_PLACEHOLDERS
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
Debian 9 [10 too?]
Disabling boost 1.73 warnings;

otpch.h
above
Code:
#ifdef __OTPCH__
add
Code:
#define BOOST_BIND_NO_PLACEHOLDERS
"10) Random C++ errors - warnings handled as errors, because of configuration."
Did not hide these errors?

I will post soon git compare of replacing openssl (RSA and SHA) with gmp+cryptopp.
 
Last edited:

adrian224

New Member
Joined
Oct 13, 2012
Messages
14
Reaction score
0
Code:
[email protected]:~/ots2/source$ make
make  all-am
make[1]: Entering directory '/home/ubuntu/ots2/source'
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__     -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-parentheses -Wno-unused-parameter -Werror=sign-compare -Wno-unused-but-set-variable -Wno-array-bounds -pthread -pipe -c -o databasemysql.o databasemysql.cpp
databasemysql.cpp: In constructor ‘DatabaseMySQL::DatabaseMySQL()’:
databasemysql.cpp:47:2: error: ‘my_bool’ was not declared in this scope; did you mean ‘bool’?
   47 |  my_bool reconnect = true;
      |  ^~~~~~~
      |  bool
databasemysql.cpp:48:49: error: ‘reconnect’ was not declared in this scope; did you mean ‘connect’?
   48 |  mysql_options(&m_handle, MYSQL_OPT_RECONNECT, &reconnect);
      |                                                 ^~~~~~~~~
      |                                                 connect
make[1]: *** [Makefile:599: databasemysql.o] Error 1
make[1]: Leaving directory '/home/ubuntu/ots2/source'
make: *** [Makefile:445: all] Error 2
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
Code:
[email protected]:~/ots2/source$ make
make  all-am
make[1]: Entering directory '/home/ubuntu/ots2/source'
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__     -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-parentheses -Wno-unused-parameter -Werror=sign-compare -Wno-unused-but-set-variable -Wno-array-bounds -pthread -pipe -c -o databasemysql.o databasemysql.cpp
databasemysql.cpp: In constructor ‘DatabaseMySQL::DatabaseMySQL()’:
databasemysql.cpp:47:2: error: ‘my_bool’ was not declared in this scope; did you mean ‘bool’?
   47 |  my_bool reconnect = true;
      |  ^~~~~~~
      |  bool
databasemysql.cpp:48:49: error: ‘reconnect’ was not declared in this scope; did you mean ‘connect’?
   48 |  mysql_options(&m_handle, MYSQL_OPT_RECONNECT, &reconnect);
      |                                                 ^~~~~~~~~
      |                                                 connect
make[1]: *** [Makefile:599: databasemysql.o] Error 1
make[1]: Leaving directory '/home/ubuntu/ots2/source'
make: *** [Makefile:445: all] Error 2
Replace:
Code:
my_bool reconnect = true;
With:
Code:
bool reconnect = true;

Adding to first post.
 

adrian224

New Member
Joined
Oct 13, 2012
Messages
14
Reaction score
0
Code:
talkaction.cpp:248:15: note:   ‘std::__cxx11::basic_stringstream<char>’ is not derived from ‘std::_Setfill<_CharT>’
  248 |         ss << sl << "...";
      |               ^~
In file included from /usr/include/boost/exception/detail/object_hex_dump.hpp:10,
                 from /usr/include/boost/exception/to_string_stub.hpp:10,
                 from /usr/include/boost/exception/info.hpp:11,
                 from /usr/include/boost/exception/detail/exception_ptr.hpp:14,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:34,
                 from /usr/include/boost/thread.hpp:24,
                 from otsystem.h:34,
                 from talkaction.h:20,
                 from talkaction.cpp:18:
/usr/include/c++/10/iomanip:208:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_Ch, _Tr>& std::operator<<(std::basic_ostream<_Ch, _Tr>&, std::_Setprecision)’
  208 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:208:5: note:   template argument deduction/substitution failed:
talkaction.cpp:248:15: note:   cannot convert ‘sl’ (type ‘std::stringstream’ {aka ‘std::__cxx11::basic_stringstream<char>’}) to type ‘std::_Setprecision’
  248 |         ss << sl << "...";
      |               ^~
In file included from /usr/include/boost/exception/detail/object_hex_dump.hpp:10,
                 from /usr/include/boost/exception/to_string_stub.hpp:10,
                 from /usr/include/boost/exception/info.hpp:11,
                 from /usr/include/boost/exception/detail/exception_ptr.hpp:14,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:34,
                 from /usr/include/boost/thread.hpp:24,
                 from otsystem.h:34,
                 from talkaction.h:20,
                 from talkaction.cpp:18:
/usr/include/c++/10/iomanip:238:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_Ch, _Tr>& std::operator<<(std::basic_ostream<_Ch, _Tr>&, std::_Setw)’
  238 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:238:5: note:   template argument deduction/substitution failed:
talkaction.cpp:248:15: note:   cannot convert ‘sl’ (type ‘std::stringstream’ {aka ‘std::__cxx11::basic_stringstream<char>’}) to type ‘std::_Setw’
  248 |         ss << sl << "...";
      |               ^~
In file included from /usr/include/boost/exception/detail/object_hex_dump.hpp:10,
                 from /usr/include/boost/exception/to_string_stub.hpp:10,
                 from /usr/include/boost/exception/info.hpp:11,
                 from /usr/include/boost/exception/detail/exception_ptr.hpp:14,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:34,
                 from /usr/include/boost/thread.hpp:24,
                 from otsystem.h:34,
                 from talkaction.h:20,
                 from talkaction.cpp:18:
/usr/include/c++/10/iomanip:311:5: note: candidate: ‘template<class _CharT, class _Traits, class _MoneyT> std::basic_ostream<_Ch, _Tr>& std::operator<<(std::basic_ostream<_Ch, _Tr>&, std::_Put_money<_MoneyT>)’
  311 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:311:5: note:   template argument deduction/substitution failed:
talkaction.cpp:248:15: note:   ‘std::__cxx11::basic_stringstream<char>’ is not derived from ‘std::_Put_money<_MoneyT>’
  248 |         ss << sl << "...";
      |               ^~
In file included from /usr/include/boost/exception/detail/object_hex_dump.hpp:10,
                 from /usr/include/boost/exception/to_string_stub.hpp:10,
                 from /usr/include/boost/exception/info.hpp:11,
                 from /usr/include/boost/exception/detail/exception_ptr.hpp:14,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:34,
                 from /usr/include/boost/thread.hpp:24,
                 from otsystem.h:34,
                 from talkaction.h:20,
                 from talkaction.cpp:18:
/usr/include/c++/10/iomanip:363:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_Ch, _Tr>& std::operator<<(std::basic_ostream<_Ch, _Tr>&, std::_Put_time<_CharT>)’
  363 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_time<_CharT> __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:363:5: note:   template argument deduction/substitution failed:
talkaction.cpp:248:15: note:   ‘std::__cxx11::basic_stringstream<char>’ is not derived from ‘std::_Put_time<_CharT>’
  248 |         ss << sl << "...";
      |               ^~
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__     -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-parentheses -Wno-unused-parameter -Werror=sign-compare -Wno-unused-but-set-variable -Wno-array-bounds -pthread -pipe -c -o waitlist.o waitlist.cpp
make[1]: *** [Makefile:599: talkaction.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/ubuntu/ots2/source'
make: *** [Makefile:445: all] Error 2
[email protected]:~/ots2/source$
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
Code:
talkaction.cpp:248:15: note:   ‘std::__cxx11::basic_stringstream<char>’ is not derived from ‘std::_Setfill<_CharT>’
  248 |         ss << sl << "...";
      |               ^~
In file included from /usr/include/boost/exception/detail/object_hex_dump.hpp:10,
                 from /usr/include/boost/exception/to_string_stub.hpp:10,
                 from /usr/include/boost/exception/info.hpp:11,
                 from /usr/include/boost/exception/detail/exception_ptr.hpp:14,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:34,
                 from /usr/include/boost/thread.hpp:24,
                 from otsystem.h:34,
                 from talkaction.h:20,
                 from talkaction.cpp:18:
/usr/include/c++/10/iomanip:208:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_Ch, _Tr>& std::operator<<(std::basic_ostream<_Ch, _Tr>&, std::_Setprecision)’
  208 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:208:5: note:   template argument deduction/substitution failed:
talkaction.cpp:248:15: note:   cannot convert ‘sl’ (type ‘std::stringstream’ {aka ‘std::__cxx11::basic_stringstream<char>’}) to type ‘std::_Setprecision’
  248 |         ss << sl << "...";
      |               ^~
In file included from /usr/include/boost/exception/detail/object_hex_dump.hpp:10,
                 from /usr/include/boost/exception/to_string_stub.hpp:10,
                 from /usr/include/boost/exception/info.hpp:11,
                 from /usr/include/boost/exception/detail/exception_ptr.hpp:14,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:34,
                 from /usr/include/boost/thread.hpp:24,
                 from otsystem.h:34,
                 from talkaction.h:20,
                 from talkaction.cpp:18:
/usr/include/c++/10/iomanip:238:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_Ch, _Tr>& std::operator<<(std::basic_ostream<_Ch, _Tr>&, std::_Setw)’
  238 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:238:5: note:   template argument deduction/substitution failed:
talkaction.cpp:248:15: note:   cannot convert ‘sl’ (type ‘std::stringstream’ {aka ‘std::__cxx11::basic_stringstream<char>’}) to type ‘std::_Setw’
  248 |         ss << sl << "...";
      |               ^~
In file included from /usr/include/boost/exception/detail/object_hex_dump.hpp:10,
                 from /usr/include/boost/exception/to_string_stub.hpp:10,
                 from /usr/include/boost/exception/info.hpp:11,
                 from /usr/include/boost/exception/detail/exception_ptr.hpp:14,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:34,
                 from /usr/include/boost/thread.hpp:24,
                 from otsystem.h:34,
                 from talkaction.h:20,
                 from talkaction.cpp:18:
/usr/include/c++/10/iomanip:311:5: note: candidate: ‘template<class _CharT, class _Traits, class _MoneyT> std::basic_ostream<_Ch, _Tr>& std::operator<<(std::basic_ostream<_Ch, _Tr>&, std::_Put_money<_MoneyT>)’
  311 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:311:5: note:   template argument deduction/substitution failed:
talkaction.cpp:248:15: note:   ‘std::__cxx11::basic_stringstream<char>’ is not derived from ‘std::_Put_money<_MoneyT>’
  248 |         ss << sl << "...";
      |               ^~
In file included from /usr/include/boost/exception/detail/object_hex_dump.hpp:10,
                 from /usr/include/boost/exception/to_string_stub.hpp:10,
                 from /usr/include/boost/exception/info.hpp:11,
                 from /usr/include/boost/exception/detail/exception_ptr.hpp:14,
                 from /usr/include/boost/exception_ptr.hpp:9,
                 from /usr/include/boost/thread/exceptional_ptr.hpp:10,
                 from /usr/include/boost/thread/future.hpp:34,
                 from /usr/include/boost/thread.hpp:24,
                 from otsystem.h:34,
                 from talkaction.h:20,
                 from talkaction.cpp:18:
/usr/include/c++/10/iomanip:363:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_Ch, _Tr>& std::operator<<(std::basic_ostream<_Ch, _Tr>&, std::_Put_time<_CharT>)’
  363 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_time<_CharT> __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:363:5: note:   template argument deduction/substitution failed:
talkaction.cpp:248:15: note:   ‘std::__cxx11::basic_stringstream<char>’ is not derived from ‘std::_Put_time<_CharT>’
  248 |         ss << sl << "...";
      |               ^~
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__     -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-parentheses -Wno-unused-parameter -Werror=sign-compare -Wno-unused-but-set-variable -Wno-array-bounds -pthread -pipe -c -o waitlist.o waitlist.cpp
make[1]: *** [Makefile:599: talkaction.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/ubuntu/ots2/source'
make: *** [Makefile:445: all] Error 2
[email protected]:~/ots2/source$
I'm not 100% sure, because I don't know what engine it is.
Try to replace:
Code:
ss << sl << "...";
with:
Code:
ss << sl.str() << "...";
@adrian224 if you got more errors, message me on Discord: Gesior.pl#3208

EDIT:

Fixing OpenSSL RSA error:
Code:
otserv.cpp: In function ‘void otserv(StringVec, ServiceManager*)’:
otserv.cpp:599:18: error: invalid use of incomplete type ‘RSA’ {aka ‘struct rsa_st’}
  BN_dec2bn(&g_RSA->p, g_config.getString(ConfigManager::RSA_PRIME1).c_str());
                  ^~
In file included from /usr/include/openssl/crypto.h:25,
                 from /usr/include/openssl/bio.h:20,
                 from /usr/include/openssl/asn1.h:16,
                 from /usr/include/openssl/rsa.h:16,
                 from otserv.cpp:44:
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA’ {aka ‘struct rsa_st’}
 typedef struct rsa_st RSA;
You must replace outdated OpenSSL library with Crypto++ and GMP libraries.
Example of replacing libraries and algorithms RSA, MD5, SHA1, SHA256, SHA512 with RSA and SHA1 (other algorithms removed) in OTX2 engine:
 
Last edited:

wlucas

New Member
Joined
Mar 17, 2021
Messages
2
Reaction score
0
make all-am
make[1]: Entering directory '/home/usuario1/ot/src'
make[1]: Leaving directory '/home/usuario1/ot/src'
This happens after step 11. I can't go on. What should I do?
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
This happens after step 11. I can't go on. What should I do?
I got no idea what you did before. It looks like message you get, when you compile engine again, without changes in sources files - 'make' does nothing as there is already compiled file.
If you can't compile, message me on Discord: Gesior.pl#3208
 

danylook2

Member
Joined
Dec 17, 2011
Messages
63
Reaction score
5
Location
United Kingdom, Birmingham
I got some error any idea ?
1:~/tfs_0.4_on_debian_10-main# ./configure --enable-mysql --disable-dependency-tracking
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... none
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for ptrdiff_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for ceil... yes
checking for floor... yes
checking for ftime... yes
checking for gethostbyname... yes
checking for gethostname... yes
checking for memset... yes
checking for pow... yes
checking for sqrt... yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strtol... yes
checking for xml2-config... /usr/bin/xml2-config
checking for libxml - version >= 2.6.5... yes (version 2.9.9)
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for __gmpz_init2 in -lgmp... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for main in -lz... yes
checking for main in -lboost_thread-gcc-mt... no
checking for main in -lboost_thread-mt... no
checking for main in -lboost_thread... yes
checking for main in -lboost_regex-gcc-mt... no
checking for main in -lboost_regex-mt... no
checking for main in -lboost_regex... yes
checking for main in -lboost_system-gcc-mt... no
checking for main in -lboost_system-mt... no
checking for main in -lboost_system... yes
checking for main in -lboost_date_time-gcc-mt... no
checking for main in -lboost_date_time-mt... no
checking for main in -lboost_date_time... yes
checking for main in -lboost_filesystem-gcc-mt... no
checking for main in -lboost_filesystem-mt... no
checking for main in -lboost_filesystem... yes
checking boost/asio.hpp usability... yes
checking boost/asio.hpp presence... yes
checking for boost/asio.hpp... yes
checking boost/unordered_set.hpp usability... yes
checking boost/unordered_set.hpp presence... yes
checking for boost/unordered_set.hpp... yes
checking cryptopp/sha.h usability... yes
checking cryptopp/sha.h presence... yes
checking for cryptopp/sha.h... yes
checking cryptopp/md5.h usability... yes
checking cryptopp/md5.h presence... yes
checking for cryptopp/md5.h... yes
checking cryptopp/adler32.h usability... yes
checking cryptopp/adler32.h presence... yes
checking for cryptopp/adler32.h... yes
checking cryptopp/hex.h usability... yes
checking cryptopp/hex.h presence... yes
checking for cryptopp/hex.h... yes
checking cryptopp/base64.h usability... yes
checking cryptopp/base64.h presence... yes
checking for cryptopp/base64.h... yes
checking cryptopp/hmac.h usability... yes
checking cryptopp/hmac.h presence... yes
checking for cryptopp/hmac.h... yes
checking cryptopp/cryptlib.h usability... yes
checking cryptopp/cryptlib.h presence... yes
checking for cryptopp/cryptlib.h... yes
checking for main in -lcryptopp... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LUA... yes
checking mysql/mysql.h usability... yes
checking mysql/mysql.h presence... yes
checking for mysql/mysql.h... yes
checking for main in -lmysqlclient... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands

theforgottenserver 0.4

Server diagnostics.......... : no
Login server mode........... : no
OTAdmin protocol............ : no
Root run permission......... : no
Login server mode........... : no
Home-directory configuration : no
OTServ custom allocator..... : no
Debug build................. : no
Using LuaJIT................ : no

Build with MySQL............ : yes
Build with SQLite........... : no
Build with PostgreSQL....... : no

Configure complete, now you may type './build.sh'.
[email protected]:~/tfs_0.4_on_debian_10-main# sh build.sh
TheForgottenServer build script- seems to speed things up ALOT.
CCache: OK
CCache binaries located in /usr/lib/ccache
Building on 2 cores, using 3 processes
make all-am
make[1]: Entering directory '/root/tfs_0.4_on_debian_10-main'
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o actions.o actions.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o allocator.o allocator.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o baseevents.o baseevents.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o beds.o beds.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o chat.o chat.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o combat.o combat.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o condition.o condition.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o configmanager.o configmanager.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o connection.o connection.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o container.o container.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o creature.o creature.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o creatureevent.o creatureevent.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o cylinder.o cylinder.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o database.o database.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o databasemanager.o databasemanager.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o databasemysql.o databasemysql.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o depot.o depot.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o dispatcher.o dispatcher.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o exception.o exception.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o fileloader.o fileloader.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o game.o game.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o globalevent.o globalevent.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o group.o group.cpp
game.cpp: In constructor ‘Game::Game()’:
game.cpp:80:24: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
globalSaveMessage = false;
Code:
~~~~~~~~~~~~~~~~~~^~~~~~~
game.cpp:79:23: note: within this loop
  for(int32_t i = 0; i < 3; i++)
                     ~~^~~
In file included from game.cpp:18:0:
game.h: In member function ‘void Game::globalSave()’:
game.h:613:78: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
 setGlobalSaveMessage(int16_t key, bool value) {globalSaveMessage[key] = value;}
                                                ~~~~~~~~~~~~~~~~~~~~~~~^~~~
game.cpp:6180:23: note: within this loop
for(int16_t i = 0; i < 3; i++)
~~^~~
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o house.o house.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o housetile.o housetile.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o ioban.o ioban.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o ioguild.o ioguild.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o iologindata.o iologindata.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o iomap.o iomap.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o iomapserialize.o iomapserialize.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o item.o item.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o itemattributes.o itemattributes.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o items.o items.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o luascript.o luascript.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o mailbox.o mailbox.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o manager.o manager.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o map.o map.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o monster.o monster.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o monsters.o monsters.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o movement.o movement.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o networkmessage.o networkmessage.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o npc.o npc.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o otserv.o otserv.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o outfit.o outfit.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o outputmessage.o outputmessage.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o party.o party.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o player.o player.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o position.o position.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o protocol.o protocol.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o protocolgame.o protocolgame.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o protocolhttp.o protocolhttp.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o protocollogin.o protocollogin.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o protocolold.o protocolold.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o quests.o quests.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o raids.o raids.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o rsa.o rsa.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o scheduler.o scheduler.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o scriptmanager.o scriptmanager.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o server.o server.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o spawn.o spawn.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o spells.o spells.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o status.o status.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o talkaction.o talkaction.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o teleport.o teleport.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o textlogger.o textlogger.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o thing.o thing.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o tile.o tile.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o tools.o tools.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o trashholder.o trashholder.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o waitlist.o waitlist.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o weapons.o weapons.cpp
g++ -DHAVE_CONFIG_H -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -c -o vocation.o vocation.cpp
g++ -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -o theforgottenserver actions.o allocator.o baseevents.o beds.o chat.o combat.o condition.o configmanager.o connection.o container.o creature.o creatureevent.o cylinder.o database.o databasemanager.o databasemysql.o depot.o dispatcher.o exception.o fileloader.o game.o globalevent.o group.o house.o housetile.o ioban.o ioguild.o iologindata.o iomap.o iomapserialize.o item.o itemattributes.o items.o luascript.o mailbox.o manager.o map.o monster.o monsters.o movement.o networkmessage.o npc.o otserv.o outfit.o outputmessage.o party.o player.o position.o protocol.o protocolgame.o protocolhttp.o protocollogin.o protocolold.o quests.o raids.o rsa.o scheduler.o scriptmanager.o server.o spawn.o spells.o status.o talkaction.o teleport.o textlogger.o thing.o tile.o tools.o trashholder.o waitlist.o weapons.o vocation.o -llua5.1 -lmysqlclient -lcryptopp -lboost_filesystem -lboost_date_time -lboost_system -lboost_regex -lboost_thread -lz -lgmp -lxml2 -lpthread
make[1]: Leaving directory '/root/tfs_0.4_on_debian_10-main'
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
I got some error any idea ?
1. It compiled. It will work.
2. Do you mean this?
Code:
game.cpp:79:23: note: within this loop
  for(int32_t i = 0; i < 3; i++)
 setGlobalSaveMessage(int16_t key, bool value) {globalSaveMessage[key] = value;}
That bug was there from loooong time and server did not crash. New compiler detects it automatically and reports while compilation. You can fix it or ignore. What engine is it? TFS 0.4 rev. 3777 or some other version?
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
That was TFS 0.4 rev 3777 on debian 9 i can't compile that one i can't fix it.
Code:
g++ -I/usr/include/libxml2 -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__ -D_THREAD_SAFE -D_REENTRANT -Wno-strict-aliasing -pipe -o theforgottenserver actions.o allocator.o baseevents.o beds.o chat.o combat.o condition.o configmanager.o connection.o container.o creature.o creatureevent.o cylinder.o database.o databasemanager.o databasemysql.o depot.o dispatcher.o exception.o fileloader.o game.o globalevent.o group.o house.o housetile.o ioban.o ioguild.o iologindata.o iomap.o iomapserialize.o item.o itemattributes.o items.o luascript.o mailbox.o manager.o map.o monster.o monsters.o movement.o networkmessage.o npc.o otserv.o outfit.o outputmessage.o party.o player.o position.o protocol.o protocolgame.o protocolhttp.o protocollogin.o protocolold.o quests.o raids.o rsa.o scheduler.o scriptmanager.o server.o spawn.o spells.o status.o talkaction.o teleport.o textlogger.o thing.o tile.o tools.o trashholder.o waitlist.o weapons.o vocation.o -llua5.1 -lmysqlclient -lcryptopp -lboost_filesystem -lboost_date_time -lboost_system -lboost_regex -lboost_thread -lz -lgmp -lxml2 -lpthread
make[1]: Leaving directory '/root/tfs_0.4_on_debian_10-main'
It says it finished and there is no error. There should be file 'theforgottenserver' - your compiled binary.

Message above is only 'warning' about one 'for loop' in C++ code. Some programmer should check code and make sure it won't crash server or generate other problem. As this code works for 12 years, it's probably not a real problem.
 

ckripz

Member
Joined
May 30, 2013
Messages
68
Reaction score
7
i am using ubuntu 20.04

at the end of the compilation I get this:
C++:
make  all-am
make[1]: Entering directory '/home/sources'
g++ -I/usr/include/libxml2  -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__    -D__ENABLE_SERVER_DIAGNOSTIC__ -D__ROOT_PERMISSION__ -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-parentheses -Wno-unused-parameter -Werror=sign-compare -Wno-unused-but-set-variable -Wno-array-bounds -pthread -pipe   -o theforgottenserver actions.o  allocator.o baseevents.o beds.o chat.o combat.o condition.o configmanager.o connection.o container.o creature.o creatureevent.o cylinder.o database.o databasemanager.o databasemysql.o   depot.o dispatcher.o exception.o fileloader.o game.o  globalevent.o group.o house.o housetile.o ioban.o ioguild.o iologindata.o iomap.o iomapserialize.o item.o itemattributes.o items.o luascript.o mailbox.o manager.o map.o monster.o monsters.o movement.o networkmessage.o npc.o otserv.o outfit.o outputmessage.o party.o player.o position.o protocol.o protocolgame.o protocolhttp.o protocollogin.o protocolold.o quests.o raids.o rsa.o scheduler.o scriptmanager.o server.o spawn.o spells.o status.o talkaction.o teleport.o textlogger.o thing.o tile.o tools.o trashholder.o waitlist.o weapons.o vocation.o -llua5.1 -lmysqlclient -lcrypto -lcryptopp -lboost_filesystem -lboost_date_time -lboost_system -lboost_regex -lboost_thread -lz  -lxml2
/usr/bin/ld: rsa.o: in function `RSA::~RSA()':
rsa.cpp:(.text+0x18): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x21): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x2a): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x33): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x3c): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.o:rsa.cpp:(.text+0x48): more undefined references to `__gmpz_clear' follow
/usr/bin/ld: rsa.o: in function `RSA::getPublicKey(char*)':
rsa.cpp:(.text+0xdd): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: rsa.cpp:(.text+0x15e): undefined reference to `__gmpz_export'
/usr/bin/ld: rsa.o: in function `RSA::RSA()':
rsa.cpp:(.text+0x29f): undefined reference to `__gmpz_init2'
/usr/bin/ld: rsa.cpp:(.text+0x2ad): undefined reference to `__gmpz_init2'
/usr/bin/ld: rsa.cpp:(.text+0x2bb): undefined reference to `__gmpz_init2'
/usr/bin/ld: rsa.cpp:(.text+0x2c9): undefined reference to `__gmpz_init2'
/usr/bin/ld: rsa.cpp:(.text+0x2d7): undefined reference to `__gmpz_init2'
/usr/bin/ld: rsa.o:rsa.cpp:(.text+0x2e8): more undefined references to `__gmpz_init2' follow
/usr/bin/ld: rsa.o: in function `RSA::decrypt(char*)':
rsa.cpp:(.text+0x52b): undefined reference to `__gmpz_import'
/usr/bin/ld: rsa.cpp:(.text+0x54b): undefined reference to `__gmpz_mod'
/usr/bin/ld: rsa.cpp:(.text+0x565): undefined reference to `__gmpz_powm'
/usr/bin/ld: rsa.cpp:(.text+0x582): undefined reference to `__gmpz_mod'
/usr/bin/ld: rsa.cpp:(.text+0x59f): undefined reference to `__gmpz_powm'
/usr/bin/ld: rsa.cpp:(.text+0x5ad): undefined reference to `__gmpz_sub'
/usr/bin/ld: rsa.cpp:(.text+0x5c3): undefined reference to `__gmpz_mul'
/usr/bin/ld: rsa.cpp:(.text+0x5d5): undefined reference to `__gmpz_mod'
/usr/bin/ld: rsa.cpp:(.text+0x5f6): undefined reference to `__gmpz_mul'
/usr/bin/ld: rsa.cpp:(.text+0x600): undefined reference to `__gmpz_set_ui'
/usr/bin/ld: rsa.cpp:(.text+0x612): undefined reference to `__gmpz_add'
/usr/bin/ld: rsa.cpp:(.text+0x61f): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: rsa.cpp:(.text+0x686): undefined reference to `__gmpz_export'
/usr/bin/ld: rsa.cpp:(.text+0x690): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x698): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x6a0): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x6a8): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x6b4): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x745): undefined reference to `__gmpz_add'
/usr/bin/ld: rsa.cpp:(.text+0x750): undefined reference to `__gmpz_set'
/usr/bin/ld: rsa.o: in function `RSA::initialize(char const*, char const*, char const*)':
rsa.cpp:(.text+0x857): undefined reference to `__gmpz_set_str'
/usr/bin/ld: rsa.cpp:(.text+0x86b): undefined reference to `__gmpz_set_str'
/usr/bin/ld: rsa.cpp:(.text+0x87f): undefined reference to `__gmpz_set_str'
/usr/bin/ld: rsa.cpp:(.text+0x891): undefined reference to `__gmpz_init2'
/usr/bin/ld: rsa.cpp:(.text+0x8a3): undefined reference to `__gmpz_init2'
/usr/bin/ld: rsa.cpp:(.text+0x8b3): undefined reference to `__gmpz_sub_ui'
/usr/bin/ld: rsa.cpp:(.text+0x8c3): undefined reference to `__gmpz_sub_ui'
/usr/bin/ld: rsa.cpp:(.text+0x8d2): undefined reference to `__gmpz_invert'
/usr/bin/ld: rsa.cpp:(.text+0x8e1): undefined reference to `__gmpz_mod'
/usr/bin/ld: rsa.cpp:(.text+0x8f3): undefined reference to `__gmpz_mod'
/usr/bin/ld: rsa.cpp:(.text+0x905): undefined reference to `__gmpz_mul'
/usr/bin/ld: rsa.cpp:(.text+0x90d): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x915): undefined reference to `__gmpz_clear'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:503: theforgottenserver] Error 1
make[1]: Leaving directory '/home/sources'
make: *** [Makefile:445: all] Error 2

in this post someone has the same error with Debian 8

[8.60] TFS 0.4 Rev3996 War & Cast (https://otland.net/threads/8-60-tfs-0-4-rev3996-war-cast.271278/)
 
Last edited:
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,350
Solutions
42
Reaction score
1,778
Location
Poland
GitHub
gesior
i am using ubuntu 20.04

at the end of the compilation I get this:
C++:
make  all-am
make[1]: Entering directory '/home/sources'
g++ -I/usr/include/libxml2  -I/usr/include/lua5.1 -O2 -fomit-frame-pointer -D__USE_MYSQL__    -D__ENABLE_SERVER_DIAGNOSTIC__ -D__ROOT_PERMISSION__ -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -Wno-parentheses -Wno-unused-parameter -Werror=sign-compare -Wno-unused-but-set-variable -Wno-array-bounds -pthread -pipe   -o theforgottenserver actions.o  allocator.o baseevents.o beds.o chat.o combat.o condition.o configmanager.o connection.o container.o creature.o creatureevent.o cylinder.o database.o databasemanager.o databasemysql.o   depot.o dispatcher.o exception.o fileloader.o game.o  globalevent.o group.o house.o housetile.o ioban.o ioguild.o iologindata.o iomap.o iomapserialize.o item.o itemattributes.o items.o luascript.o mailbox.o manager.o map.o monster.o monsters.o movement.o networkmessage.o npc.o otserv.o outfit.o outputmessage.o party.o player.o position.o protocol.o protocolgame.o protocolhttp.o protocollogin.o protocolold.o quests.o raids.o rsa.o scheduler.o scriptmanager.o server.o spawn.o spells.o status.o talkaction.o teleport.o textlogger.o thing.o tile.o tools.o trashholder.o waitlist.o weapons.o vocation.o -llua5.1 -lmysqlclient -lcrypto -lcryptopp -lboost_filesystem -lboost_date_time -lboost_system -lboost_regex -lboost_thread -lz  -lxml2
/usr/bin/ld: rsa.o: in function `RSA::~RSA()':
rsa.cpp:(.text+0x18): undefined reference to `__gmpz_clear'
/usr/bin/ld: rsa.cpp:(.text+0x21): undefined reference to `__gmpz_clear'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:503: theforgottenserver] Error 1
make[1]: Leaving directory '/home/sources'
make: *** [Makefile:445: all] Error 2

in this post someone has the same error with Debian 8

[8.60] TFS 0.4 Rev3996 War & Cast (https://otland.net/threads/8-60-tfs-0-4-rev3996-war-cast.271278/)
There are some 0.4 servers with updated .cpp and .h files, to make them use GMP in place of OpenSSL. They compiled on old linux versions (or old g++), as there were auto-added all c++ libraries installed in system.
To make it compile on new linux versions, you must add 'gmp' library to project. Edit file configure.ac and under line:
Code:
LIBS="$LIBS $XML_LIBS"
Add:
Code:
LIBS="$LIBS -lgmp"
After that change you must run again:
Code:
sh autogen.sh
./configure --enable-mysql
 

Gsp

RP
Joined
Jan 3, 2008
Messages
249
Solutions
1
Reaction score
4
Dear Gesior, Ive been trying to compile my source files TFS 3884 on Debian 11 (tried 10 also, i dont think it will make a difference). I'm currently running the server on Debian 8, i will have to shut it down if I cant upgrade the system years of work will be gone. I've done lots of editing in the last 2 days, everything you've written. Had to replace openssl fixed like 50 errors till now but Im stuck on these ones maybe you might be able to help. I feel that im very close
Thank you!
Bash:
protocolgame.cpp: In member function ‘bool ProtocolGame::parseFirstPacket(NetworkMessage&)’:
protocolgame.cpp:411:6: error: ‘RSA_decrypt’ was not declared in this scope
  411 |  if(!RSA_decrypt(msg))
C++:
bool ProtocolGame::parseFirstPacket(NetworkMessage& msg)
{
    if(g_game.getGameState() == GAMESTATE_SHUTDOWN)
    {
        getConnection()->close();
        return false;
    }

    OperatingSystem_t operatingSystem = (OperatingSystem_t)msg.get<uint16_t>();
    uint16_t version = msg.get<uint16_t>();
    if(!RSA_decrypt(msg))
    {
        getConnection()->close();
        return false;
    }
Bash:
protocollogin.cpp: In member function ‘bool ProtocolLogin::parseFirstPacket(NetworkMessage&)’:
protocollogin.cpp:75:6: error: ‘RSA_decrypt’ was not declared in this scope
   75 |  if(!RSA_decrypt(msg))
C++:
bool ProtocolLogin::parseFirstPacket(NetworkMessage& msg)
{
    if(g_game.getGameState() == GAMESTATE_SHUTDOWN)
    {
        getConnection()->close();
        return false;
    }

    uint32_t clientIp = getConnection()->getIP();
    /*uint16_t operatingSystem = msg.get<uint16_t>();*/msg.skip(2);
    uint16_t version = msg.get<uint16_t>();

    msg.skip(12);
    if(!RSA_decrypt(msg))
    {
        getConnection()->close();
        return false;
    }
Bash:
protocolold.cpp: In member function ‘bool ProtocolOld::parseFirstPacket(NetworkMessage&)’:
protocolold.cpp:65:6: error: ‘RSA_decrypt’ was not declared in this scope
   65 |  if(!RSA_decrypt(msg))
C++:
bool ProtocolOld::parseFirstPacket(NetworkMessage& msg)
{
    if(g_game.getGameState() == GAMESTATE_SHUTDOWN)
    {
        getConnection()->close();
        return false;
    }

    /*uint16_t operatingSystem = */msg.get<uint16_t>();
    uint16_t version = msg.get<uint16_t>();
    msg.skip(12);
    if(version <= 760)
        disconnectClient(0x0A, CLIENT_VERSION_STRING);

    if(!RSA_decrypt(msg))
    {
        getConnection()->close();
        return false;
    }
 
Top