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

Solved rev 3777 on ubuntu 14 or 13

ex eclipse

New Member
Joined
Jul 15, 2007
Messages
282
Reaction score
1
Location
Brazil
is there a way to compile rev 3777 (8,6) on ubuntu 13 or 14? cuz it gives lots of errors
i already tried to find tutorial but there is none
if someone knows how to..
thanks
 
Follow one of the hundreds of tutorials here on OTLand for compiling old tfs
thanks for helping, but old tutorials only works on ubuntu 10.

im trying now on ubuntu 12 i've removed -Werror from Makefile.am and added #include <sys/signal.h> to otserv.cpp.

Code:
RANT -Wall -Wextra -Werror -Wno-strict-aliasing -pipe -MT chat.o -MD -MP -MF .deps/chat.Tpo -c -o chat.o chat.cpp
chat.cpp: In member function âChatChannel* Chat::getChannel(Player*, uint16_t)â:
chat.cpp:1144:10: error: converting âfalseâ to pointer type âChatChannel*â [-Werror=conversion-null]
mv -f .deps/beds.Tpo .deps/beds.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1   -O2 -fomit-frame-pointer -D__USE_MYSQL__    -D__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Werror -Wno-strict-aliasing -pipe -MT combat.o -MD -MP -MF .deps/combat.Tpo -c -o combat.o combat.cpp
cc1plus: all warnings being treated as errors
make[1]: *** [chat.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/combat.Tpo .deps/combat.Po
make[1]: Leaving directory `/usr/otserver/source'
make: *** [all] Error 2
 
Last edited:
i erased last post it was

Code:
fomit-frame-pointer -D__USE_MYSQL__    -D__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTR                                              ANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT group.o -MD -MP -MF .deps/group                                              .Tpo -c -o group.o group.cpp
game.cpp: In constructor âGame::Game()â:
game.cpp:81:22: warning: array subscript is above array bounds [-Warray-bounds]
mv -f .deps/group.Tpo .deps/group.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1   -O2 -                                              fomit-frame-pointer -D__USE_MYSQL__    -D__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTR                                              ANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT house.o -MD -MP -MF .deps/house                                              .Tpo -c -o house.o house.cpp
In file included from game.cpp:18:0:
game.h: In member function âvoid Game::globalSave()â:
game.h:613:76: warning: array subscript is above array bounds [-Warray-bounds]
game.cpp: In member function âvoid Game::prepareGlobalSave()â:
game.cpp:6154:30: warning: array subscript is above array bounds [-Warray-bounds                                              ]
game.cpp:6156:22: warning: array subscript is above array bounds [-Warray-bounds                                              ]



luascript.cpp: In member function âbool LuaInterface::loadDirectory(const string&, Npc*)â:
luascript.cpp:741:23: error: âclass boost::filesystem3::directory_entryâ has no member named âleafâ
make[1]: *** [luascript.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/mailbox.Tpo .deps/mailbox.Po
make[1]: Leaving directory `/usr/otserver/source'
make: *** [all] Error 2

I'll do what u said on game.cpp and rebuild right now

also i removed -werrors from makefile .. is it necessary? i read it in another topic..
 
The first ones are just warnings so ignore them. for the second one:

go to luascript.cpp line 741 and replace "leaf()" with "path().filename().string()"

Leave -werrors, its necesarry
 
Last edited:
really thanks for helping ... but i still have errors :(

Code:
make[1]: Entering directory `/usr/otserver/source'
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1   -O2 -fomit-frame-pointer -D__USE_MYSQL__    -D__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT scriptmanager.o -MD -MP -MF .deps/scriptmanager.Tpo -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__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTRANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT server.o -MD -MP -MF .deps/server.Tpo -c -o server.o server.cpp
scriptmanager.cpp: In member function âbool ScriptManager::loadMods()â:
scriptmanager.cpp:130:23: error: âclass boost::filesystem3::directory_entryâ has no member named âleafâ
make[1]: *** [scriptmanager.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/server.Tpo .deps/server.Po
make[1]: Leaving directory `/usr/otserver/source'
make: *** [all] Error 2

also i saw another errors during compilation
Code:
make[1]: Entering directory `/usr/otserver/source'
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1   -O2 -                                              fomit-frame-pointer -D__USE_MYSQL__    -D__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTR                                              ANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT luascript.o -MD -MP -MF .deps/l                                              uascript.Tpo -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__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTR                                              ANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT manager.o -MD -MP -MF .deps/man                                              ager.Tpo -c -o manager.o manager.cpp
luascript.cpp: In static member function âstatic int32_t LuaInterface::luaGetTow                                              nTemplePosition(lua_State*)â:
luascript.cpp:9191:7: warning: variable âdisplayErrorâ set but not used [-Wunuse                                              d-but-set-variable]
mv -f .deps/manager.Tpo .deps/manager.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1   -O2 -                                              fomit-frame-pointer -D__USE_MYSQL__    -D__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTR                                              ANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT map.o -MD -MP -MF .deps/map.Tpo                                               -c -o map.o map.cpp
mv -f .deps/map.Tpo .deps/map.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1   -O2 -                                              fomit-frame-pointer -D__USE_MYSQL__    -D__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTR                                              ANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT monster.o -MD -MP -MF .deps/mon                                              ster.Tpo -c -o monster.o monster.cpp
mv -f .deps/luascript.Tpo .deps/luascript.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1   -O2 -                                              fomit-frame-pointer -D__USE_MYSQL__    -D__WAR_SYSTEM__ -D_THREAD_SAFE -D_REENTR                                              ANT -Wall -Wextra -Wno-strict-aliasing -pipe -MT monsters.o -MD -MP -MF .deps/mo                                              nsters.Tpo -c -o monsters.o monsters.cpp
monster.cpp: In member function âvirtual void Monster::doAttacking(uint32_t)â:
monster.cpp:626:26: warning: variable âoutOfRangeâ set but not used [-Wunused-but-set-variable]


Line 130 of scriptmanager is samething than luascript

std::string s = it->leaf();

i'll change leaf() to path().filename().string() too and try again
 
well it compile but server is "killed" when i try to run..

Code:
[16:4:40.220] >> Loading map and spawns...
[16:4:42.543] > Map size: 50000x50000.
[16:4:42.544] > Map descriptions:
[16:4:42.544] "Saved with Remere's Map Editor 2.2"
[16:4:42.544] ""
[16:4:48.940] Duplicate uniqueId 1010
[16:4:51.560] Duplicate uniqueId 2520
[16:4:52.873] Duplicate uniqueId 50015
[16:4:53.589] Duplicate uniqueId 2337
[16:4:53.757] Duplicate uniqueId 2339
[16:4:53.918] Duplicate uniqueId 2340
[16:4:54.549] Duplicate uniqueId 30017
[16:4:54.562] Duplicate uniqueId 30019
[16:4:54.678] Duplicate uniqueId 30017
[16:4:54.840] Duplicate uniqueId 2341
[16:4:55.076] Duplicate uniqueId 30022
[16:4:55.165] Duplicate uniqueId 2338
[16:4:55.200] Duplicate uniqueId 2335
[16:4:55.237] Duplicate uniqueId 2336
[16:4:55.969] Duplicate uniqueId 2407
Killed

server got 4gb ram..
 
Last edited:
hi again now I tried to compile on ubuntu 14 and it didnt work :( and some warnings while compiling
Code:
game.cpp: In constructor âGame::Game()â:
game.cpp:81:22: warning: array subscript is above array bounds [-Warray-bounds]
   globalSaveMessage[i] = false;
                      ^
In file included from game.cpp:18:0:
game.h: In member function âvoid Game::globalSave()â:
game.h:613:76: warning: array subscript is above array bounds [-Warray-bounds]
   void setGlobalSaveMessage(int16_t key, bool value) {globalSaveMessage[key] = value;}
                                                                            ^
game.cpp: In member function âvoid Game::prepareGlobalSave()â:
game.cpp:6154:30: warning: array subscript is above array bounds [-Warray-bounds]
  else if(!globalSaveMessage[2])
                              ^
game.cpp:6156:22: warning: array subscript is above array bounds [-Warray-bounds]
   globalSaveMessage[2] = true;
                      ^
mv -f .deps/game.Tpo .deps/game.Po
Code:
luascript.cpp: In static member function âstatic int32_t LuaInterface::luaGetTownTemplePosition(lua_State*)â:
luascript.cpp:9191:7: warning: variable âdisplayErrorâ set but not used [-Wunused-but-set-variable]
  bool displayError = true;
Code:
monster.cpp: In member function âvirtual void Monster::doAttacking(uint32_t)â:
monster.cpp:626:26: warning: variable âoutOfRangeâ set but not used [-Wunused-but-set-variable]
  bool updateLook = true, outOfRange = true;


and the final error
Code:
/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
make[1]: *** [theforgottenserver] Error 1
make[1]: Leaving directory `/usr/otserver/source'
make: *** [all] Error 2

I tryed to add -lpthread in "LIBS =" line of the makefile and replace line
AM_CXXFLAGS = $(XML_CPPFLAGS) $(OTSERV_FLAGS) $(LUA_CFLAGS) $(DEBUG_FLAGS)\
with
AM_CXXFLAGS = -pthread $(XML_CPPFLAGS) $(OTSERV_FLAGS) $(LUA_CFLAGS) $(DEBUG_FLAGS)\
but didnt work :/
 
Last edited:
Back
Top