Howto compile

From UDB

Jump to: navigation, search

Under Construction, still alot to change/tweak

[edit] How to compile MaNGOS for Windows

Required Software:

   * A Windows Operating System
   * A version of MS Visual C++:
         o Visual Studio 6 (Version 7/2003)
         o Visual Studio 2005 (Version 8/2005) + SP1
         o Visual C++ 2005 Express Edition (Version 8/2005). Available here for free.
         o Possibly this patch for SP-1, especially if you are on Vista.
   * TortoiseSVN - a freeware source sharing application available here.


     Filebeam Downloads :
     Microsoft Visual Studio Express 2005
     Microsoft Platform SDK


Install MS Visual C++:

   * Visual C++ 2005 Express Edition
         o You must also install and configure Platform SDK to use Visual C++ 2005 Express Edition. Carefully follow the instructions here. Follow the first 4 steps completely and the first half of step 5! DO NOT just download and install. Follow the instructions or you will not be able to compile. Need help? See this
         o SP-1 is recommended.
   * Visual Studio 2005
         o You must install SP-1 for VS 2005. (The old "functional" file update is no longer needed with SP-1.)


Install TortoiseSVN and Set Up SVN Folders:

   * Install Tortoise SVN
   * Create a directory on your hard drive. For example: "C:\sources\mangos\"
   * Right click on the folder "\mangos\" and select "SVN Checkout"
         o On the top line where it says "URL of Repository" put in the url "https://mangos.svn.sourceforge.net/svnroot/mangos/trunk/".
         o Do not change any other options, then press ok. This will download the most current source code.
   * (Note: If you will be using scripting (i.e. scriptdev) you will need to retrieve and prep it in a similar manner at this point. Consult your preferred source for scripts for instructions on how to include scripts in a MaNGOS compilation. DO NOT ask for assistance with scripts on this forum.)


Updating Your Source Files (Only for updates, not first time compilations. Skip this section if you are a compile virgin.)

   * Right click on the "C:\sources\mangos\" folder and select update.
   * If an update is available it will be immediately downloaded to this directory replacing any previous files. You will see a list of the files being added and/or updated as the process completes.
   * Once the update is complete you will see a dialog such as "Completed At revision: ####". That is your new revision number.
   * From here you can select the "show log..." button to get a listing of what was added or updated or press ok to exit.
   * From this point simply continue to the compilation process as listed below.
   * IMPORTANT: Anytime you update this directory check to see if either of the *.conf.in files were updated. MaNGOS will not function if you do not have the current .conf files. (If they were not updated, then you can continue using your existing .conf files.)
   * IMPORTANT: Also make sure to always check the "C:\sources\mangos\sql\updates\" directory for new files. This directory contains SQL queries that modify the database structure and are critical for the core to function. If you get a new revision make sure that all the SQL updates with numbers <= your current revision number have been loaded in your database. These files only need to be loaded once.
   * Suggestion: Learn as much as you can about TortoiseSVN through it's help files and web site. It's an outstanding tool for source sharing. The more you learn about it the more you will be able to do with the MaNGOS source code. (Like custom or pre-release code patches you might see on the forums!)


Compile MaNGOS:

   * Browse your computer to "C:\sources\mangos\win\" and double-click (open) the .sln file for your VC++ version
         o mangosdVC71.sln - Version 7/2003 (Visual Studio 6)
         o mangosdVC80.sln - Version 8/2005 (Visual Studio 2005/VC++ Express)
   * In your VC++ application window select Build->Configuration Manager from the menu.
         o Select "Release" in the drop down for "Active Solution Configuration"
         o "Active Solution Platform" should default to "Win32". Do not change this.
         o Close the dialog.
   * Now select Build->Build Solution from the menu. (Note: If you had an error or are having problems with the build you can select Build->Clean Solution to "reset" the compilation.)
   * Your MaNGOS application will now begin compiling.
         o This may take quite some time depending on the speed of your processor.
         o You WILL get various warning messages. This is expected and should not alarm you.
         o When the process is complete you should see a message like "Build: 8 succeeded, 0 failed, 0 up-to-date, 0 skipped". The key is to make sure that failed = 0. (If you are doing an update of an existing build you may get a message like "Build: 2 succeeded, 0 failed, 6 up-to-date, 0 skipped". Again, no failures so you are in good shape.)
   * Occasionally you will get this error: "error LNK1181: cannot open input file 'mangosd.lib'". In order to fix this iussue you can do these steps (once):
         o Right-click on "Solution 'mangosdVC80' (8 projects)" in solution explorer.
         o Select "Project Build Order..."
         o Click on the "Dependencies" tab.
         o In the "Projects:" drop down list, select "script" and check "mangosd" and hit OK.
         o Build Solution.
     Credits to rusty.

Elegos's guide from MaNGOS forums (With Permision)

[edit] How to compile MaNGOS for Linux

Required Software:

   * A Linux-Based Operating System
   * GCC 3.3 and above (suggested latest) (I use: GCC 4.1.1)
   * make (I use: 3.81)
   * libtool
   * automake (1.5 and above. Suggested latest one (not 1.10 but 1.9))
   * autoconf (I use: 2.60)
   * glibc & glibc-dev(glibc headers)
   * mysql 4.1 or above (suggested 5) (I use: mysql-server 5.0 && libmysql++-dev)
   * OpenSSL (I use: 0.9.8d - libssl-dev)
   * subversion (I use: subversion 1.3.2)
   * zlibc


Note: you will probably also need python libs. Please reply to this thread if you have some troubles configuring (./configure) ManGOS

Installing the required software (UBUNTU USERS):

This part really depends on which linux distro you have installed. This mini-guide is for Ubuntu (gnome) users:

   * Be sure to have a Universe and Multiverse sources.list in order to have the most updated software. To enable it, search on Official Ubuntu Forums
   * Open Synaptic (As admin user go to the menu System -> Administration -> Synaptic)
   * Search for every needed component and add a tick on their left. Agree when Synaptic asks you if you want to install the dependence files.
   * Click on 'Apply'. It will take some time (depending on your PC and internet connection)


Download the latest version of ManGOS:

   * Create a new directory on your hard drive. For example: "/home/[user]/sources/mangos"
   * In console execute this line:
     svn checkout https://mangos.svn.sourceforge.net/svnroot/mangos/trunk /home/[user]/sources/mangos
   * (Note: If you will be using scripting (i.e. scriptdev) you will need to retrieve and prep it in a similar manner at this point. Consult your preferred source for scripts for instructions on how to include scripts in a MaNGOS compilation. DO NOT ask for assistance with scripts on this forum.)


Updating Your Source Files (Only for updates, not first time compilations. Skip this section if you are a compile virgin.)

   * In console execute this line:
     svn checkout https://mangos.svn.sourceforge.net/svnroot/mangos/trunk /home/[user]/sources/mangos
   * If an update is available it will be immediately downloaded to this directory replacing any previous files. You will see a list of the files being added and/or updated as the process completes. (A = added, U = updated, D = deleted)
   * Once the update is complete you will see a new line: 'Extracted version ####'. That is your new revision number.
   * In order to see the changelog, please consult this XML file: ManGOS Revision Log.
   * IMPORTANT: Anytime you update this directory check to see if either of the *.conf.in files were updated. MaNGOS will not function if you do not have the current .conf files. (If they were not updated, then you can continue using your existing .conf files.)
   * IMPORTANT: Also make sure to always check the "/home/[user]/sources/mangos/sql/updates" directory for new files. This directory contains SQL queries that modify the database structure and are critical for the core to function. If you get a new revision make sure that all the SQL updates with numbers <= your current revision number have been loaded in your database. These files only need to be loaded once.


Compile MaNGOS:

   * Create a new folder: /home/[user]/sources/mangos/bin
   * Open the console and browse to /home/[user]/sources/mangos
   * Execute this line:
     autoreconf --install
   * And then this line:
     ./configure --prefix=[working path] --sysconfdir=[working path]/etc --with-python --enable-cli --enable-ra --datadir=[working path]
   * Then this line:
     make
   * And eventually:
     make install

Elegos's guide from MaNGOS forums (With Permision)

Personal tools