• 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 Compiling error tfs 0.3

beliar34

Member
Joined
Feb 28, 2012
Messages
307
Solutions
7
Reaction score
11
After "make"
Code:
++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1  -D__USE_MYSQL__     -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_SAFE -D_REENTRANT -DCMAKE_CXX_FLAGS=-stdlib=libstdc++ -g -O1 -MT actions.o -MD -MP -MF .deps/actions.Tpo -c -o actions.o actions.cpp
In file included from const.h:20:0,
                 from actions.cpp:18:
definitions.h:160:32: error: ‘tr1’ in namespace ‘std’ does not name a type
   #define OTSERV_HASH_SET std::tr1::unordered_set
                                ^
house.h:76:11: note: in expansion of macro ‘OTSERV_HASH_SET’
   typedef OTSERV_HASH_SET<uint32_t> PlayerList;
           ^
Makefile:566: recipe for target 'actions.o' failed
make[1]: *** [actions.o] Error 1

Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-47-generic x86_64)
 
Solution
1.
Code:
g++ -v
You probably got version 5 of higher. TFS 0.3 was made in times of 4.8-4.9
2. in definitions.h line 160 replace:
Code:
#define OTSERV_HASH_SET std::tr1::unordered_set
with:
Code:
#define OTSERV_HASH_SET std::unordered_set
In old g++ version (0.3 has 8 years?), it was in 'std::tr1' namespace (as new tested feature), but now it's in 'std'.
1.
Code:
g++ -v
You probably got version 5 of higher. TFS 0.3 was made in times of 4.8-4.9
2. in definitions.h line 160 replace:
Code:
#define OTSERV_HASH_SET std::tr1::unordered_set
with:
Code:
#define OTSERV_HASH_SET std::unordered_set
In old g++ version (0.3 has 8 years?), it was in 'std::tr1' namespace (as new tested feature), but now it's in 'std'.
 
Solution
Well thanks, i am compiling will update post if compile will go smoothly to the end :)

@@ update
ERROR :

Code:
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1  -D__USE_MYSQL__      -D_THREAD_SAFE -D_REENTRANT  -g -O1 -MT protocolgame.o -MD -MP -MF .deps/protocolgame.Tpo -c -o protocolgame.o protocolgame.cpp
protocolgame.cpp: In member function ‘virtual void ProtocolGame::parsePacket(NetworkMessage&)’:
protocolgame.cpp:828:61: error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’ and ‘std::stringstream {aka std::__cxx11::basic_stringstream<char>}’)
            s << player->getName() << " sent unknown byte: " << hex << std::endl;
another error that i am strugling to fix


@Gesior.pl


@@ update 2
Solution :
replace
Code:
<< hex
with
Code:
<< hex.str()

@@ update 3
ERROR :
Code:
talkaction.cpp: In member function ‘bool TalkActions::onPlayerSay(Creature*, uint16_t, const string&, bool)’:
talkaction.cpp:114:43: error: array must be initialized with a brace-enclosed initializer [-fpermissive]
  std::string cmdstring[TALKFILTER_LAST] = words, paramstring[TALKFILTER_LAST] = "";
                                           ^~~~~
talkaction.cpp:114:81: error: array must be initialized with a brace-enclosed initializer [-fpermissive]
  std::string cmdstring[TALKFILTER_LAST] = words, paramstring[TALKFILTER_LAST] = "";
                                                                                 ^~

SOLUTION :

C#:
    std::string cmdstring[TALKFILTER_LAST] = {{words}}, paramstring[TALKFILTER_LAST] = {{""}};


ERROR :
Code:
g++ -I/usr/include/libxml2  -I/usr/include/lua5.1  -D__USE_MYSQL__      -D_THREAD_SAFE -D_REENTRANT  -g -O1   -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 exception.o fileloader.o game.o  globalevent.o group.o gui.o house.o housetile.o inputbox.o ioban.o ioguild.o iologindata.o iomap.o iomapserialize.o item.o items.o luascript.o mailbox.o map.o md5.o monster.o monsters.o movement.o networkmessage.o npc.o otserv.o outfit.o outputmessage.o party.o playerbox.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 sha1.o spawn.o spells.o status.o talkaction.o tasks.o teleport.o textlogger.o thing.o tile.o tools.o trashholder.o waitlist.o weapons.o vocation.o -llua5.1 -lmysqlclient -lboost_filesystem -lboost_date_time -lboost_system -lboost_regex -lgmp  -lxml2
/usr/bin/ld: connection.o: undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:475: recipe for target 'theforgottenserver' failed

SOLUTION :
Code:
open file Makefile, find line statring with "LIBS =" and add at the end of this line " -lpthread" without these quotes



Special Thanks for @Gesior.pl becouse without him i wouldnt start :) Errors that i fixed was 5 min fixes :) I really stuck on first one Greetings for Gesior

Best Regards, ~B3liar.
 
Last edited:
Uhm everything compilled fine but i got little problem, when i want to use "empty" commands that dont need params like
!aol
!save
!balance

Every command need something behind like spacebar or something when i just type "x" talkaction they dont work just show as default text in chat
any ideas ? problem is somewhere in "
Code:
std::string cmdstring[TALKFILTER_LAST] = {{words}}, paramstring[TALKFILTER_LAST] = {{""}};

after 5 mins solved :
Solution :
Replace :

Code:
std::string cmdstring[TALKFILTER_LAST] = {{words}}, paramstring[TALKFILTER_LAST] = {{""}};

with

C#:
    std::string cmdstring[TALKFILTER_LAST] = {words, words, words}, paramstring[TALKFILTER_LAST] = {"", "", ""};



I hope those post will help somebody in the future with same problems ...
 
Last edited:
Back
Top