Sari la conținut



Building our Extern from the very beginning

Postări Recomandate

NOTE: Using this you will need my Boost 1.55+ fix here, or if you already fixed ok

If the tutorial have already posted, i didn't saw it

If this tutorial is useless, old, bla bla. Let me know, i will immediatly remove

It's intended as a Noob-like tutorial


Windows Requirement:

Visual Studio 2012+ (I use VS2017)

Other Systems:

C/C++ Compiler (such as CLang/GCC)

Bash Shell (for export command)


Mini tutorial if you don't have Bash installed in your FreeBSD system (i dubt it)

  Hide contents
Let's type this 3 commands:

pkg install bash
echo "fdesc    /dev/fd        fdescfs        rw    0    0" >> /etc/fstab
mount /dev/fd


For setting Bash as default shell

pw usermod root -s "/usr/local/bin/bash"



Step 1: Create our folders

Create our Extern folder on the top directory of Server folder (uppercase and lowercase are important)

Inside our Extern we need to create 2 folders

include (for inclusions file)

lib (for libraries)

Like this:


Step 2: Boost

Download boost here

You will have an archive similar to this


Exteract boost folder to Extern\include

Step 3: Crypto++

Download Crypto++ here

You will have something similar


Extract all the files into a folder (like Extern\cryptopp)


Now we'll create a folder called cryptopp in Extern\include and we will execute this 3 commands

cd "folder where we extracted cryptopp" (ex.: Y:/Metin2/Extern/cryptopp565)
cp *.h "folder Extern\include\cryptopp" (ex.: Y:/Metin2/Extern/include/cryptopp)
cp *.asm "folder Extern\include\cryptopp"

Then create a file called cryptoppLibLink.h (UPPERCASE is important), put this inside

  Reveal hidden contents

save this file in Extern\include\cryptopp

Step 3.1: Crypto++ Building

     For Windows:

       Open crypttest.sln


     Then, it will ask us to update the project, let's do it

      We need to build in Debug\Win32 and Release\Win32 only "cryptlib" project


      After the compition is done it will create a folder called Win32 in our cryptopp folder


      Inside that there will be another folder called Output, let's go inside

      Copy Release\cryptlib.lib to Extern\lib

      Go to Debug folder

            Rename cryptlib.lib to cryptlib_d.lib

            Rename cryptlib.pdb to cryptlib_d.pdb

      Let's copy the 2 files we reneamed into Extern\lib

     For Other Systems:

         We will open GNUMakefile (not GNUMakefile-cross), go to line 446 you will find this


         Add this 2 lines

CC = "our C Compiler" (like: gcc6)
CXX = "our C++ Compiler" (like: g++6)

         We will have something similar to this


         Then, type this commands

cd "folder where we extracted cryptopp" (ex.: \Metin2\Extern\cryptopp565)

         After the compilation is done you will find a file called libcryptopp.a, copy that to Extern\lib folder

Step 4: LZO

       Download LZO here

       Inside the ZIP file, go inside include folder and copy "lzo" folder to Extern/include

       Extract the whole file into a folder (like Extern/lzo210)


        For Not-Windows Systems:

           Type this commands:

cd "Folder where we extracted LZO" (ex.: Y:/Metin2/Extern/lzo210)
chmod 777 configure
chmod 777 autoconf/install-sh
./configure CC="Same CC Value that we used on Crypto++"

           If you have assembly-related issues type this

./configure --disable-asm CC="Same CC value that we used for Crypto++"

          Then let's go to folder src/.libs (inside the folder where we extracted lzo), copy liblzo2.a to Extern/lib folder

    For Windows Systems:

          Open a Visual Studio command prompt

          (Start -> All Programs -> Visual Studio 2017 -> Visual Studio Tools -> Developer command prompt) for Visual Studio 2017

           Open the file B\win32\vc.bat (from the folder where you extracted LZO) and make sure line 10 it's this:
set CC=cl -nologo -MT -DNDEBUG

           then from our CMD type this

cd "Folder where you extracted LZO" (es.: Y:/Metin2/Extern/lzo210)
          After the compilation, let's copy lzo2.lib into Extern\lib Una volta fatto ciò copiamo il file lzo2.lib in Extern\lib
          Let's open B\win32\vc.bat again and edit the line 10 to this:
set CC=cl -nologo -MTd -DDEBUG

          then type "B\win32\vc.bat" again and

          Rename lzo2.lib to lzo2_d.lib and copy that to Extern/lib

Step 5: DevIL

           Building DevIL it's very long, we won't do that. We will use prebuilded binary

           For not Windows OS:

                 Let's install it

sudo apt-get install libdevil-dev (ubuntu)
pkg install devil (freebsd)

             Type this command:

cp -r /usr/local/include/IL "folder Extern/include" (freebsd)
cp -r /usr/include/IL "folder Extern/include" (ubuntu)

            Then open our makefile and change:

LIBS += -lIL -lpng -ltiff -lmng -llcms -ljpeg



             then under it add:

LIBDIR += -L/usr/local/lib

       For Windows OSes:

             Go here
             Download 1.8.0 SDK and extact include folder into Extern
             Go to this folder lib\x86\Release (on the ZIP file) and exract DevIL.lib into Extern\lib
             Both for out client and server the DevIL DLL is "DevIL.dll" found inside

Step 6: MariaDB/Mysql C Connector (Server Only)

                WARNING: The choice of MySQL or MariaDB may vary based on your system, if you installed MariaDB you must use MariaDB Connector C, if you installed MySQL you must use MySQL Connector C
               Not Windows OS:
                    pkg install mariadb101-client or pkg install mysql56-client (version 101 and 56 may vary)
                    Add this to your game,db and libsql Makefile


INCDIR += -I/usr/local/include/mysql (if you installed mysql)
INCDIR += -I/usr/local/include/mariadb (if you installed mariadb)
                  Add this for game,db
LIBDIR += -L/usr/local/lib/mysql (for mysql)
LIBDIR += -L/usr/local/lib/mariadb (for mariadb)

                 If you still got linking erros (for mariadb), change the LIBDIR into mysql

            Windows OS:

                Download MySQL Connector C here or MariaDB Connector C here

                WARNING: Only Win32 versions

                The folders where you can find includes and lib for them are here

C:/Program Files (x86)\MySQL/MySQL Connector C X.X (where X.X is the version of the connector that you installed)
C:/Program Files (x86)/MariaDB/MariaDB Connector C

              Copy include folder into Extern\include

               Rename the include folder that we copyied mysql (inside Extern\include)

               For MySQL:
                            Go to lib\ folder and select your vs version (vs12/vs14), copy mysqlclient.lib into Extern\lib
               For MariaDB:
                             Go to lib\ and find your vs version (vs12/vs14), copy mariadbclient.lib into Extern\lib, rename this to mysqlclient.lib


            Google Tests: (Extra part for not Windows OSes)

  Hide contents

Download or clone googletests here here
Extract everything and type this commands

Codice (Text):
cd "folder where you extracted googletests"
mkdir build
cd build
export CC=/usr/local/bin/"same as crypto++"
export CXX=/usr/local/bin/"same as crypto++"
cmake ../

Copy build/googlemock/gtest/libgtest.a into Extern/lib
Copy gtest folder from googletest/include to Extern/include


                Server Extern IS OK!

Step 6: libjpeg (Client Only)

       Download LibJpeg (IJG) here
       Extract everything in a folder
       Create a folder called libjpeg in Extern/include
       Open a command prompt and type this
cd "folder where we extracted libjpeg"
cp *.h "folder Extern/include"/libjpeg
cp *.asm "folder Extern/include"/libjpeg


     Create a folder called jpegliblink.h in Extern/include/libjpeg with this content:

  Hide contents

#ifndef _JPEG_LIBLINK_H_
#define _JPEG_LIBLINK_H_

#ifdef _DEBUG
#pragma comment(lib, "libjpeg_d.lib")
#pragma comment(lib, "libjpeg.lib")



       Copy into Extern/include/libjpeg, rename it to jconfig.h.
Step 6.1: Building libjpeg
Open a Visual Studio Command Prompt (lke before) and type this commands:
cd "folder where we extracted libjpeg"
nmake /f


It will be generated a file called libjpeg.lib, copy it into Extern/lib, rename that to libjpeg_d.lib

Copy file vcXXX.pdb (where XXX is your visual studio version like 140) copy it into Extern/lib and rename it into libjpeg_d.pdb

Then type these commands:

nmake /f clean
nmake /f NODEBUG=1


and copy libjpeg.lib to Extern/lib

--> If you have this error: "Cannot rename" or similar, rename into jconfig.h
--> If you have this error: "Cannot find Win32.mak" or similar, create a new file called Win32.mak and paste this inside

Final Step for Client

         Go to dev/Extern/include (original ymir source) and extract every file that are NOT inside a folder (like d3dx8.h)



     The circled files are a few of the files that you need to copy

      Go to dev\Exteren\lib folder

      Extract all files into Extern\lib (our Extern folder) excluding files that we already builded (like: boost-*, DevIL, cryptlib, cryptopp*, lzo2, libjpeg) (a file that you need to copy, for example, is dxguid.lib)


        The file with name deleted dosen't need to be copyied


That's it. We successfully upgraded our Extern so we could take advantage of the 9999 bugfixes that are inside

Sorry for any grammatical error or english mistake (it was originally written in italian), if something isn't clear or not ordered tell me and i will edit

Partajează acest post

Link spre post
Distribuie pe alte site-uri

Creează un cont sau autentifică-te pentru a adăuga comentariu

Trebuie să fi un membru pentru a putea lăsa un comentariu.

Creează un cont

Înregistrează-te pentru un nou cont în comunitatea nostră. Este simplu!

Înregistrează un nou cont


Ai deja un cont? Autentifică-te aici.

Autentifică-te acum