[Compiling] Simple OTServ MSVC 2010/Linux : Compiling the Source

Pietia

Excellent OT User
Joined
Jan 13, 2008
Messages
2,142
Best answers
0
Reaction score
40
Location
Poland
Windows
1.Download and install msvc 2010 http://www.microsoft.com/express/Downloads/#2010-Visual-CPP
2.Download latest trunk https://github.com/opentibia/server/archive/legacy.zip


3.Open visual studio project it is located in project-files/vc10/vc10.sln (project)

4.Download and unpack https://www.sendspace.com/file/fz1o43 those are additional libs to compile otserv(boost etc).
5.In msvc select Release option instead of Debug it is located in top center in the program.
6.Select otserv project in left side of visual studio then go to project > properties > C/C++ > general > additional include directories and there add "include" directory from where you unpacked additional libs.
7.In msvc Go to project > properties > linker > general > additional library directories and there add "libs" directory from where you unpacked additional libs.
8.Right click on otserv project in left side and choose rebuild project.
9.After some minutes otserv should be in project-files/vc10/Release/otserv.exe
10.Copy it to some other dir along with config.lua.dist rename it to config.lua and otserv.pdb and dlls from
https://www.sendspace.com/file/tj6dtt

Isn't that simple ?:)
Big thanks to Simone for compiling newest libs and releasing them i just made it more simpler :)


Patch level 1 : Upgraded boost to 1.47 upgraded sqlite to 3.7.7.1 and added missing .pdb file , also added missing .dlls for some systems ,added openssl for TFS 0.4 Compilation.


LINUX Debian;

aptitude install autoconf libxml2-dev liblua5.1-0-dev g++ libgmp3-dev libboost-filesystem1.49-dev libboost-system1.49-dev libboost-regex1.49-dev libboost-thread1.49-dev make libsqlite3-dev libmysqlclient15-dev mysql-server liblua5.1-sql-mysql-dev

cd src
./autogen.sh
./configure --enable-mysql
make

you can use make -j 8 for example if you have 8 cores it will speed up compilation x8.
 
Last edited:

fellah

New Member
Joined
Mar 12, 2012
Messages
2
Best answers
0
Reaction score
0
Hey, thanks for the great tutorial! I'm just wondering, each time I recompile, will all files be affected or is it just the otserv file that changes? Btw I'm using Linux
 
OP
Pietia

Pietia

Excellent OT User
Joined
Jan 13, 2008
Messages
2,142
Best answers
0
Reaction score
40
Location
Poland
Hey, thanks for the great tutorial! I'm just wondering, each time I recompile, will all files be affected or is it just the otserv file that changes? Btw I'm using Linux
it depends if you change .h your compilator probably will want to recompile all files .
 

Ezzz

Developer
Joined
Feb 26, 2010
Messages
1,690
Best answers
2
Reaction score
410
Location
Quito, Ecuador
it depends if you change .h your compilator probably will want to recompile all files .
No, it depends:

  • The header file is included on the precompiled header (This will increase compilation time)
  • The header file is included on some other header / cpp files, the files including the modified header file will have to be compiled again
 

skillboy

Member
Joined
Jun 17, 2015
Messages
53
Best answers
0
Reaction score
3
Its unpossible for me to Compile Ot-master Source at windows
 

ed.1337

New Member
Joined
Nov 23, 2010
Messages
1
Best answers
0
Reaction score
0
I GET THIS ERROR

/server-legacy/src$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
 

Szpaku17

Member
Joined
Mar 16, 2009
Messages
37
Best answers
0
Reaction score
0
make all-am
make[1]: Entering directory `/home/ott/src'
make[1]: Leaving directory `/home/ott/src'
Where is theforgottenserver to start server.. ??
 

login12

void newbie scripter()
Joined
Feb 26, 2011
Messages
153
Best answers
0
Reaction score
17
Location
Brazil
it dont compile in ubuntu 14.04?
Code:
mv -f .deps/guild.Tpo .deps/guild.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1    -D__USE_MYSQL__      -DSYSCONFDIR=\"/usr/local/etc\" -DPKGDATADIR=\"/usr/local/share/otserv\" -D_THREAD_SAFE -D__OLD_GUILD_SYSTEM__ -D_REENTRANT -Wall -g -O2 -MT globalevent.o -MD -MP -MF .deps/globalevent.Tpo -c -o globalevent.o globalevent.cpp
In file included from globalevent.cpp:22:0:
player.h: In member function ‘uint32_t Player::getCastIpByName(std::string)’:
player.h:180:10: warning: converting to non-pointer type ‘uint32_t {aka unsigned int}’ from NULL [-Wconversion-null]
   return NULL;
          ^
mv -f .deps/globalevent.Tpo .deps/globalevent.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1    -D__USE_MYSQL__      -DSYSCONFDIR=\"/usr/local/etc\" -DPKGDATADIR=\"/usr/local/share/otserv\" -D_THREAD_SAFE -D__OLD_GUILD_SYSTEM__ -D_REENTRANT -Wall -g -O2 -MT abstract_lua_t.o -MD -MP -MF .deps/abstract_lua_t.Tpo -c -o abstract_lua_t.o abstract_lua_t.cpp
mv -f .deps/abstract_lua_t.Tpo .deps/abstract_lua_t.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1    -D__USE_MYSQL__      -DSYSCONFDIR=\"/usr/local/etc\" -DPKGDATADIR=\"/usr/local/share/otserv\" -D_THREAD_SAFE -D__OLD_GUILD_SYSTEM__ -D_REENTRANT -Wall -g -O2 -MT global_list_lua_manager.o -MD -MP -MF .deps/global_list_lua_manager.Tpo -c -o global_list_lua_manager.o global_list_lua_manager.cpp
mv -f .deps/global_list_lua_manager.Tpo .deps/global_list_lua_manager.Po
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1    -D__USE_MYSQL__      -DSYSCONFDIR=\"/usr/local/etc\" -DPKGDATADIR=\"/usr/local/share/otserv\" -D_THREAD_SAFE -D__OLD_GUILD_SYSTEM__ -D_REENTRANT -Wall -g -O2 -MT global_lists_lua_manager.o -MD -MP -MF .deps/global_lists_lua_manager.Tpo -c -o global_lists_lua_manager.o global_lists_lua_manager.cpp
mv -f .deps/global_lists_lua_manager.Tpo .deps/global_lists_lua_manager.Po
g++ -I/usr/include/libxml2  -I/usr/include/lua5.1    -D__USE_MYSQL__      -DSYSCONFDIR=\"/usr/local/etc\" -DPKGDATADIR=\"/usr/local/share/otserv\" -D_THREAD_SAFE -D__OLD_GUILD_SYSTEM__ -D_REENTRANT -Wall -g -O2   -o otserv databasemysql.o    map.o rsa.o actions.o md5.o scheduler.o admin.o monster.o scriptmanager.o allocator.o depot.o monsters.o server.o ban.o exception.o movement.o sha1.o baseevents.o fileloader.o networkmessage.o spawn.o beds.o game.o npc.o spells.o chat.o house.o otserv.o status.o combat.o housetile.o outfit.o talkaction.o ioaccount.o outputmessage.o tasks.o condition.o iomapotbm.o party.o teleport.o configmanager.o iomapserialize.o player.o thing.o connection.o position.o tile.o container.o ioplayer.o protocol.o tools.o creature.o item.o protocolgame.o trashholder.o creatureevent.o items.o protocollogin.o vocation.o cylinder.o logger.o protocolold.o waitlist.o database.o luascript.o quests.o weapons.o mailbox.o raids.o guild.o globalevent.o abstract_lua_t.o global_list_lua_manager.o global_lists_lua_manager.o -llua5.1   -lmysqlclient -lboost_filesystem -lboost_date_time -lboost_system -lboost_regex -lboost_thread -lgmp -lpthread  -lxml2
make[1]: Leaving directory `/home/test/test/src'
 

clouf

Intermediate OT User
Joined
Jul 5, 2012
Messages
139
Best answers
0
Reaction score
19
Some1 know why i can't compile it?
Code:
1>------ Build started: Project: otserv, Configuration: Release Win32 ------
1>  abstract_lua_t.cpp
1>  actions.cpp
1>  admin.cpp
1>  allocator.cpp
1>  ban.cpp
1>  baseevents.cpp
1>  beds.cpp
1>  chat.cpp
1>  combat.cpp
1>  condition.cpp
1>  configmanager.cpp
1>  connection.cpp
1>..\..\src\combat.cpp(1452): error C3861: 'round': identifier not found
1>..\..\src\combat.cpp(1453): error C3861: 'round': identifier not found
1>  container.cpp
1>  creature.cpp
1>  creatureevent.cpp
1>  cylinder.cpp
1>  database.cpp
1>  databasemysql.cpp
1>  databaseodbc.cpp
1>  databasepgsql.cpp
1>  databasesqlite.cpp
1>  depot.cpp
1>  exception.cpp
1>  fileloader.cpp
1>  game.cpp
1>  globalevent.cpp
1>  global_lists_lua_manager.cpp
1>  global_list_lua_manager.cpp
1>  guild.cpp
1>  house.cpp
1>  housetile.cpp
1>  ioaccount.cpp
1>  iomapotbm.cpp
1>  iomapserialize.cpp
1>  ioplayer.cpp
1>  item.cpp
1>  items.cpp
1>  logger.cpp
1>  luascript.cpp
1>  mailbox.cpp
1>  map.cpp
1>..\..\src\luascript.cpp(1032): warning C4800: 'int32_t' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(1033): warning C4800: 'int32_t' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(1034): warning C4800: 'int32_t' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(1035): warning C4800: 'int32_t' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(1036): warning C4800: 'int32_t' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(1044): warning C4800: 'int32_t' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(1161): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(1184): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(1229): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
1>..\..\src\luascript.cpp(4765): warning C4800: 'const uint32_t' : forcing value to bool 'true' or 'false' (performance warning)
1>  md5.cpp
1>  monster.cpp
1>  monsters.cpp
1>  movement.cpp
1>  networkmessage.cpp
1>  npc.cpp
1>  otpch.cpp
1>  otserv.cpp
1>  outfit.cpp
1>  outputmessage.cpp
1>  party.cpp
1>  player.cpp
1>  position.cpp
1>  protocol.cpp
1>  protocolgame.cpp
1>  protocollogin.cpp
1>  protocolold.cpp
1>  quests.cpp
1>  raids.cpp
1>  rsa.cpp
1>  scheduler.cpp
1>  scriptmanager.cpp
1>  server.cpp
1>  sha1.cpp
1>  spawn.cpp
1>  spells.cpp
1>  status.cpp
1>  talkaction.cpp
1>  tasks.cpp
1>  teleport.cpp
1>  thing.cpp
1>  tile.cpp
1>  tools.cpp
1>  trashholder.cpp
1>  vocation.cpp
1>  waitlist.cpp
1>  weapons.cpp
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
Last edited:

fortyy150

Intermediate OT User
Joined
May 10, 2010
Messages
104
Best answers
0
Reaction score
1
how to compile with war system? help please
 

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
1,520
Best answers
9
Reaction score
218
Location
Chile
these are the same libs that are being used by OTHIRE or these are another libs? if they are others could anyone upload these libs please?
thanks
 

Tatuy1

Intermediate OT User
Joined
Mar 24, 2014
Messages
138
Best answers
1
Reaction score
7
Location
México
All the links are broken, can you re upload them please?

bump
 
Top