How to compile Mangos and Scriptdev2 on Windows

So basically this is a guide on compiling mangos and scriptdev2 which is a request from Spencer (which is i’m grateful for, because well you know after a long time without writing, i just don’t know where to start again) :). But anyway what’s done is done and i’ve decided that perhaps rewriting the guide is a good idea (although i’m no longer using Mangos or other WoW Emulator). But of course this time it would be different because everything is going to be straight forward without making the guide cluttered like the old version (i think)

Anyway to make things fast for you, let’s start the guide on how to compile mangos plus scriptdev2 on Windowsbut as a side note, before we begin, this guide is tested on Windows Vista with UAC Enabled, so if you’re running Windows XP then there should be no problem for you, as for Windows 7 user unfortunately i don’t have Windows 7 yet but i think it’s just the same as Vista

Requirements

MSYSGitDownload MSYSGit

This is needed in order to get the mangos source and also make updating the source much easier and make sure to get the Full Installer for official GIT

TortoiseSVNDownload TortoiseSVN

This is needed in order to get ScriptDev2 source and also updating the source

Visual Studio Express 2008 SP1Download Visual Studio Express

Make sure to download Visual Studio Express 2008 SP1 offline Install ISO Image (748MB) that contains everything to make things much easier, and beside this guide is tested only on Visual Studio Express 2008 SP1

Note: You should use Visual Studio 2010 SP1 instead of VS2008, but make sure to use mangosdVC100.sln for mangos and scriptVC100.sln for the scriptdev2 if you use VS2010

MagicISO Virtual CD/DVD-ROMDownload MagicISO

This is needed to mount the ISO Image file so you can start the installation, but if you already have other Virtual CD program installed then there’s no need to download this

Installation

1. Install MagicISO for the first step

2. Mount Visual Studio Express 2008 SP1 Image by right clicking on MagicISO tray icon, then choose Virtual CD/DVD-ROM, then Mount Image

3. Then choose to install Visual C++ only

Visual Studio Express 2008 ISO

Visual Studio Express 2008 Setup

VS Express 2008 Install Path

4. After finished with VS Express installation then you need to install MSYSGit

MSYSGIT Install Path

In Windows Vista it’s necessary to install GIT to other directory than Program Files if UAC enabled, so in this example i installed it to C:\Git

5. Install TortoiseSVN (because TortoiseSVN installation is straight forward i don’t think i need to put image as an example) :)

Downloading Mangos and Scriptdev2 Source

1. Run GIT Bash from start menu and type

cd /c

Then type (choose only one repository from below)

Note: Links to the repositories updated. Thanks to Antz for mentioning this :)

- Wow Classic
git clone git://github.com/mangoszero/server.git mangos-git

- Wow BC
git clone git://github.com/mangosone/server.git mangos-git

- Wow WotLK
git clone git://github.com/mangos-wotlk/server.git mangos-git

- Woe Cataclysm
git clone git://github.com/mangos/server.git mangos-git

Mangos Git download

in this example i choose to download mangos to C:\mangos-git, but you can change the path if you want

Because Scriptdev2 now uses GIT as mentioned by stankyfish at the comment area below and also by one of this blog visitor via email to me. You can ignore step #2 in this process and because they’re using GIT you can use the same method like when you clone mangos source above but don’t forget to change the command like below

Note: Depending on which Mangos repository you choose earlier, you need to use the matching Scriptdev2

- WoW Classic
git clone git://github.com/scriptdev2/scriptdev2-classic.git scriptdev2

- WoW TBC
git clone git://github.com/scriptdev2/scriptdev2-tbc.git scriptdev2

- WoW WoTLK
git clone git://github.com/scriptdev2/scriptdev2.git scriptdev2

- WoW Cataclysm
git clone git://github.com/scriptdev2/scriptdev2-cata.git scriptdev2

2. Now you need to open Windows Explorer and then right click on empty area and then choose SVN Checkout to download Scriptdev2 source and then type

http://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2

as the repository URL

scriptdev2 checkout url

scriptdev2 checkout done

Compile Mangos

1. Open mangosdVC90.sln inside win directory in mangos-git directory

mangos vc9 solution file

2. Change the build configuration to Release and if you’re trying to build the x64 version make sure to change the Win32 to x64 as well

mangos build config to release

3. Click on Build and then choose Rebuild Solution

mangos rebuild solution

4. Done …

mangos compile done

Compile Scriptdev2

1. Copy the entire scriptdev2 directory to mangos-git\src\bindings

copy scriptdev2 to src bindings

2. Just like before, open scriptVC90.sln and then set the build configuration to release and if you’re trying to build the x64 version make sure to change the Win32 to x64 as well

set scriptdev2 to release

3. Then choose Build -> Rebuild Solution

rebuild scriptdev2

4. And done …

scriptdev2 compile done

Updating Mangos and Scriptdev2

Okay so we’re done with the compile process, but what if you want to update your Mangos Source later? … well all you have to do is just type

cd /c/mangos-git

and then type

git pull

update mangos source using git

And you’re done updating mangos. As for updating Scriptdev2, all you have to do is just right click on Scriptdev2 folder and then choose SVN Update

And so …

You’re done compiling mangos, the compiled binary can be found at the Bin directory inside mangos-git directory. The rest is of course to configure mangos and scriptdev2 itself, if you need help on how to configure mangos please check my new mangos configure guide

Comment?

Note: Comment may not appear right away.

165 comments on “How to compile Mangos and Scriptdev2 on Windows

    1. new issue> when I go to compile mangos it generates folders but nothing in them. and every folder errors out

  1. Is there a way to bypass virtual studio requirement? I can’t seem to get it installed without “Invalid License Error”, and I have tried about 14 times. Please get back to me if you can.

  2. alrighty i know this post is old but just thought id ask anyways incase someones out there listening im setting this up so i can play single player or on a lan with my family i was wondering if this will alow me to play wrath of the lich king or just the vanela version, or is there something else i need to do to get WOTLK working?

  3. Trying to “Build” scripdev2, however I don’t see Build anywhere. I changed to Release and x64 (since I’m on Win7 64bit) then clicked on the green “Play” icon (looks like a play button), but all I get is the following:

    1>—— Build started: Project: ScriptDev2, Configuration: Release x64 ——
    1>Error: The “ConfigurationGeneral” rule is missing from the project.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Any ideas? I’ve followed the guide throughly. 4 Times now. Am I missing something? Thank you.

  4. Linking…
    LINK : fatal error LNK1181: cannot open input file ‘mangosd.lib’
    Build log was saved at “file://c:mangos-gwinVC90script__Win32_ReleaseBuildLog.htm”
    script – 1 error(s), 0 warning(s)
    ========== Rebuild All: 7 succeeded, 5 failed, 0 skipped ==========

    I tried twice to compile mangos…

  5. Hey Reaper, I was successful in using the git clone to download files to the mangos-git directory. However when I right-click and do the SVN checkout, I type in everything correctly and under the action tab it says “error” instead of “added” like in your screenshot. Underneath it says the operation failed. What did I do wrong? Did I not install TortoiseSVN correctly?

  6. Quick question, does it matter if I only had 12 successful in compiling because you had 13? (I had 0 errors and skips) Thanks

    1. Yes, as long as you don’t get skipped or error message that means you’ve compiled it successfully :)

  7. Also, when I say I “try again” I mean I start from the beginning of the “How to compile Mangos and Scriptdev2 on Windows” guide.

    1. Um okay. Nevermind. Not sure what I did differently this last time but it randomly worked. Thanks anyway haha.

  8. While compiling the second scriptVC90.sln (in the directory “C:mangos-gitsrcbindingsscriptdev2” I get this:

    “========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========”

    When I open up the log at the end of it is this


    arathi_highlands.cpp
    alterac_mountains.cpp
    battleground.cpp
    guard_ai.cpp
    follower_ai.cpp
    escort_ai.cpp
    Linking…
    LINK : fatal error LNK1181: cannot open input file ‘mangosd.lib’
    ” (note: this is not the entire log, just the end of it)

    I have been having errors with this compile everytime I have tried to compile it. After having an error on this file I delete the folders “C:mangos-git” and “C:scriptdev2” and try again. I seem to have different errors every compile, with the error before ‘mangosd.lib’ being an ‘ace.lib’ error.

    Any ideas?

  9. I just compiled my Mangos and it only says 12 succeeded 0 warnings, 0 errors 0 failed and 0 skipped. is this alright or or will it effect everything else?

    1. I was worried because yours says 13, So woot, I know it’s not my mangos messing with my setting up a server.

  10. anyone who was having the skipped problem in c++ still having it after u hit build? coz for the life of me i cant figure why its skipping them, just wondering how or if anyone got around this?

    1. Actually i havent seen that problem before but based from the comments posted it seems that the problem appear if you try building the 64bit version in 64bit OS (p.s i don’t have 64bit OS so i can’t test it by myself)

      And according to The only safe way to compile all of them successfully is to compile it in 32bit mode

  11. I don’t suppose you could tell us how to “check out” and compile old versions of the source… something that will still work with the 1.12.x talent tree is my goal, and if I can compile it I can maybe do something about the old bugs.

  12. I’m having problems compiling mangos in visual c++ 2010 express. when i open the file visual c++ prompts me to convert the files. however, most of the files do not convert.

  13. Hi Reaper, i believe i followed your instructions to the letter, but for some reason i do not have a bin directory in C:mangos-git, and as such i have no realmd.exe or mangosd.exe? can you help!?

  14. Trouble in compile land:

    10>z:wowsrcmangossrcgameObjectGuid.h(285) : error C2143: syntax error : missing ‘;’ before ‘z:wowsrcmangossrcgameObjectGuid.h(285) : error C2913: explicit specialization; ‘std::hash’ is not a specialization of a class template
    10>z:wowsrcmangossrcgameObjectGuid.h(285) : error C2059: syntax error : ‘z:wowsrcmangossrcgameObjectGuid.h(286) : error C2143: syntax error : missing ‘;’ before ‘{‘
    10>z:wowsrcmangossrcgameObjectGuid.h(286) : error C2447: ‘{‘ : missing function header (old-style formal list?)

    Something simple I missed?

    1. All’s well. Just git pulled & retried until successful. Kudos to those on the mangos team for the speedy updates.

  15. I got to the part where I am supposed to right-click and hit the svn checkout option. It’s not showing up. I did everything word for word until this point. How do I fix this?

  16. 1>—— Rebuild All started: Project: ScriptDev2, Configuration: Release Win32 ——
    1>Deleting intermediate and output files for project ‘ScriptDev2’, configuration ‘Release|Win32’
    1>Extracting revision
    1>The system cannot find the path specified.
    1>Project : error PRJ0019: A tool returned an error code from “Extracting revision”
    1>Build log was saved at “file://c:mangos-gitsrcbindingsscriptdev2VC90ScriptDev2__Win32_ReleaseBuildLog.htm”
    1>ScriptDev2 – 1 error(s), 0 warning(s)
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    I get this message everytime I try to rebuild Scriptdev2

  17. hay. i really like your tutorial but im a bit stuck now. i am at the point when i have to compile mangos. i have win7 x64. i chose release x64 then i click on build and then rebuild solution. when it finishes i have 1 succeeded; 0 failed; 11 skipped. Acording to your image it has to be all succeeded. what should i try to do? Thanx

    1. was not using c++ visual studio express was using visual basic studio express….thanks I figured it out.

  18. Hey reaper I absolutely loved the guide and owe you tremendously. I do have one question though…do you have the Auction House Bot for this one or could you let me know the code so I can copy and paste. If AHBot is available that would be awesome. BTW if anyone wants to play on my server just email me at [email protected] and I will set you up, thank you.

    1. Hello Drewst, first of all i’m sorry for late reply because i just got back from hospital and just recently moved :)

      As for AHBOT i’d suggest you to check the mangos website directly ;)

  19. Dear Reaper X, thank you for your amazing guides and for all the effort you put into putting them together. I have tried before to make a server on one of your old guides, and I failed. But with these new and easier guides I feel much more confident ^^ However I’m getting an error when I try to use SVN Checkout to download Scriptdev2 source:

    Checkout from http://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2, revision HEAD, Fully recursive, Externals included
    OPTIONS of ‘http://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2’: 200 OK (http://scriptdev2.svn.sourceforge.net)

    I’m not sure what I did wrong. I’d appreciate your help. Thank you :D

    1. Hello Amalio :)

      If you get an error when downloading scriptdev2, as long as you’ve checked it out previously, you can keep retrying by using svn update on that directory ;)

    2. Thanks for the help ReaperX, however I keep getting the same error each time I try. I’m new to all of this, so I really have no idea what I’m doing wrong.

  20. LINK : fatal error LNK1181: cannot open input file ‘mangosd.lib’
    Build log was saved at “file://c:mangos-gitsrcbindingsscriptdev2VC90ScriptDev2__Win32_ReleaseBuildLog.htm”
    ScriptDev2 – 1 error(s), 0 warning(s)

    How do I fix this kind of error? Its when I was doing the script v90 rebuild, and for some reason I can’t get my builds to go in x64 version.

    1. I assume that you’ve compiled mangos successfully and you get that message when building scriptdev2

      Btw where did you put the scriptdev2 source? is it in mangos-source-directory/src/bindings ? if you don’t put scriptdev2 in src/bindings directory, it won’t be able to locate mangosd.lib :)