• 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 Libs error when compiling TFS 0.3.6 v8.2

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,529
Solutions
1
Reaction score
85
Location
Portugal
Hey there, I'm trying to compile > this < rev of TFS 0.3.6 but I keep getting library errors because they are outdated, so far I've tried searching for multiple compiling tutorials for this rev to find if any of them has the libraries but couldn't find anything helpful, I've also tried to downgrade my server to Ubuntu 16.04 to use older versions of those libraries needed and also failed to compile, can someone provide me the correct libraries to compile this rev please?

I was told that I shouldn't have to use older Ubuntu to fix this, so I've upgraded back my server to 18.04LTS.

Thanks in advance :)
 
Diff:
From: Lessaire
Date: Tue, 21 Apr 2020 10:46:02 -0700
Subject: [PATCH] TFS 0.35 TR1

---
Makefile.am | 2 +-
configure.ac | 2 +-
house.h | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 19bbc99..9e287d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@ noinst_PROGRAMS = theforgottenserver
CXXFLAGS = -g -O1
AM_CXXFLAGS = $(XML_CPPFLAGS) $(OTSERV_FLAGS) $(LUA_CFLAGS) $(DEBUG_FLAGS)\
$(MYSQL_FLAGS) $(SQLITE_FLAGS) $(ODBC_FLAGS) $(PGSQL_FLAGS)\
-$(PROFILER_FLAGS) $(OPTIONAL_FLAGS) -D_THREAD_SAFE -D_REENTRANT -Wall
+$(PROFILER_FLAGS) $(OPTIONAL_FLAGS) -D_THREAD_SAFE -D_REENTRANT

theforgottenserver_LDADD = $(LUA_LIBS)

diff --git a/configure.ac b/configure.ac
index 4b1019c..5704d3a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,7 +185,7 @@ AC_CHECK_LIB(boost_filesystem-gcc-mt, main, , [
AC_CHECK_HEADERS([boost/asio.hpp], , [AC_MSG_ERROR("boost::asio header not found.")])

# check for boost::unordered_set
-AC_CHECK_HEADERS([boost/tr1/unordered_set.hpp], , [AC_MSG_ERROR("boost::unordered_set header not found.")])
+AC_CHECK_HEADERS([boost/unordered_set.hpp], , [AC_MSG_ERROR("boost::unordered_set header not found.")])

#check lua 5.1
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, , [
diff --git a/house.h b/house.h
index 1129634..641b602 100644
--- a/house.h
+++ b/house.h
@@ -20,7 +20,7 @@
#include "otsystem.h"

#include <boost/regex.hpp>
-#include <boost/tr1/unordered_set.hpp>
+#include <boost/unordered_set.hpp>

#include "position.h"
#include "housetile.h"
@@ -73,7 +73,7 @@ class AccessList
void getList(std::string& _list) const;

private:
- typedef std::tr1::unordered_set<uint32_t> PlayerList;
+ typedef boost::unordered_set<uint32_t> PlayerList;
typedef std::list<std::pair<uint32_t, int32_t> > GuildList;
typedef std::list<std::string> ExpressionList;
typedef std::list<std::pair<boost::regex, bool> > RegExList;
--
2.26.0

save this to your server as /tmp/tfs.patch

in your source tree:
git apply --ignore-space-change /tmp/tfs.patch

after that you will have to autogen again, then configure.
 
First of all thank you @Lessaire.
I applied your patch and worked perfectly.
Then i had to do several fix on sources to make it compile (some explicit casting and enable -lpthread in FLAGS on Make file)

Then I encontered a new error, i moved the executable to main folder of the server granted the needed permission and (./)exetuted it, and this error was returned:

Code:
theforgottenserver: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:116: boost::condition_variable::~condition_variable(): Assertion `!ret' failed.

Aborted (core dumped)

I searched on otland and in web and everyone said that it could be multiple servers running but i did a double check with ps -A and there was no other forgottenserver running in the same time i was trying to execute my new executable.


I am doing something wrong? Is there any tip that can help me?

Thank you!
 
I did a sudo reboot and didn't work. And I also went to OVH control panel (that is my host providor) and did a reboot there, and still, the error keeps showing up :confused:
 
I dunno what to tell ya. The sources you picked are older than what I would have expected, and the line number given doesn't match what it should or you are using the wrong boost for the OS (162 instead of 165)
 
The sources we are using are the ones @Lava Titan said before, checking cat /usr/include/boost/version.hpp it says that BOOST_LIB_VERSION "1_65_1". the OS is Ubuntu 18.04 LTS, should I download other boost? If so, how can I do it? To be honest I get a litle lost when installing the libs needed to compilte the server o_O and that might be my issue, because when I search for then in Ot Land threads a lot of then are not the correct and probably outdated or wrongs to my distro OS or version.

I am running out of ideias tbh :(, thanks for you help, you have been a great help here and in other threads.

And yeah sources are very old from what I saw, if I cant solve this problem will have to give up on our ideia and use tfs 1.3 or so.
 
Your server scripts are 0.37 era?
Post automatically merged:

Bash:
 gcc -march=native -E -v - </dev/null 2>&1  | grep march

What does this spit out?
 
Last edited:
Your server scripts are 0.37 era?
Post automatically merged:

Bash:
 gcc -march=native -E -v - </dev/null 2>&1  | grep march

What does this spit out?
This:

Code:
COLLECT_GCC_OPTIONS='-march=native' '-E' '-v'
/usr/lib/gcc/x86_64-linux-gnu/7/cc1 -E -quiet -v -imultiarch x86_64-linux-gnu - -march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=haswell -fstack-protector-strong -Wformat -Wformat-security
COLLECT_GCC_OPTIONS='-march=native' '-E' '-v'
Post automatically merged:

About my server scripts all I can tell you is that what I downloaded came from here -> here, and they are suposed to be 0.3.6, so i supose to be yes the answer :D
Post automatically merged:

Well update, just installed version1.62 and runned make -j 1 (because i found my vps only have one core) and the same erros is beeing spitted out.

Is there any "debug" mode that I can run in ./theforgottenserver so I can have more logs of what is going on? Is there anything else I can do or test or change to try to debug and understand the error?

Mind blown right now. Thank you!
Post automatically merged:

Adicionnaly i runned this command: sudo lsof -i -P -n to check used ports, and 7171 is not been used. Is there any chance that config.lua have someting wrong? (sorry for this amount of questions)
 
Last edited:
Line 29 here --> your Line 116.
C++:
    public:
      BOOST_THREAD_NO_COPYABLE(condition_variable)
        condition_variable()
        {
            int res;
#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
            res=pthread_mutex_init(&internal_mutex,NULL);
            if(res)
            {
                boost::throw_exception(thread_resource_error(res, "boost::condition_variable::condition_variable() constructor failed in pthread_mutex_init"));
            }
#endif
            res = detail::monotonic_pthread_cond_init(cond);
            if (res)
            {
#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
                BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex));
#endif
                boost::throw_exception(thread_resource_error(res, "boost::condition_variable::condition_variable() constructor failed in detail::monotonic_pthread_cond_init"));
            }
        }
        ~condition_variable()
        {
            int ret;
#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
            do {
              ret = pthread_mutex_destroy(&internal_mutex);
            } while (ret == EINTR);
            BOOST_ASSERT(!ret);
#endif
            do {
              ret = pthread_cond_destroy(&cond);
            } while (ret == EINTR);
            BOOST_ASSERT(!ret);
        }

        void wait(unique_lock<mutex>& m);

        template<typename predicate_type>
        void wait(unique_lock<mutex>& m,predicate_type pred)
        {
            while(!pred()) wait(m);
        }

This isn't necessarily about a bound port. It looks like your Boost is failing a sanity check for being unable to destroy a mutex.
Somewhere BOOST_THREAD_NO_COPYABLE is used. Would be "boost::noncopyable" in the source tree.

Whatever it is, my time is better spent working on bringing forward the fork I'm already working on. If someone else is aware of bugs in instances of these classes in your 0.35 source, maybe they could shed some light.

./server.h:
33:class ServiceBase : boost::noncopyable

./server.h:
58:class ServicePort : boost::noncopyable, public boost::enable_shared_from_this<ServicePort>

./server.h:
94:class ServiceManager : boost::noncopyable

./protocol.h:
32:class Protocol : boost::noncopyable

./outputmessage.h:
34:class OutputMessage : public NetworkMessage, boost::noncopyable

./connection.h:
91:class Connection : public boost::enable_shared_from_this<Connection>, boost::noncopyable
 
Well thank you a lot, will try to compile and run other TFS to see if it run, I wanted to open a 8.6 with tfs arround 0.X but from what I see here I see there are no other chance but to open with some more updated sources (1.X) anyway if someone have others sources that I can try to compile or have any tip for this problem you welcome.


Thank you a lot, thank you @Lessaire !
 
Back
Top