Downloading and building on Microsoft Windows

From OregonCore Wiki
Revision as of 21:57, 28 December 2015 by Masterking32 (Talk | contribs) (Links)

Jump to: navigation, search


INTRODUCTION

One of the great things about OregonCore has always been that you have many choices available to you when building a system. For most of us, the first choice has been which operating system to use for our system. It was, quite likely, an easy choice to make, since we all have our preferred system. The two most popular build platforms would seem to be Microsoft Windows and one of the many varieties of Linux in common use.

As a cross-platform system, it would seem that the OS choice for OregonCore would make very little difference, and usually it hasn't. The developers have been very careful to make sure that the code will build no matter which OS you have. There have, however, been occasions when one of the platforms would build, but another would not. This has always caused some frustration for both the devlopers, as well as those of us building the code on our own systems.

At the heart of the problem was one simple detail; the Windows build and the Unix/Linux builds did not use the same method for keeping track of the components of the code during the build process. As a means to avoid this frustration, a great deal of work has gone into creating a build method using cmake, which can be managed in such a way that all of the platforms use the same process to create the software.

This guide is meant to introduce you to the proper steps in building OregonCore on your Windows system using cmake.

If you have been building cores for awhile, this is a new process for you. Don't be intimidated by the number of steps. After a couple of builds, you will probably never need to refer to this document again.

Important: As the OregonCore project is highly active, portions of the guide may be outdated. In case something fails, please check the forum, which will usually have an answer to your questions.

Software Required

  • Visual C++ 2008 Express [Free Download] (Download and run vcsetup.exe) or Visual C++ 2010 Express [Free Download].
    Beware, Express editions do not support 64-bit compilation by default and making them do so is arduous at best.
  • MySQL server [Community Edition Download] (We recommend to use the most recent 5.1.x version. If you choose to use another version, do NOT download the Essentials package. You will not be able to compile the core using that package. Download the 32bit version if you have a 32bit compiler and the 64bit version if you have a 64bit compiler.)
  • .NET Framework 3.5 [Download] (this should already have been installed with your Windows updates)
  • OpenSSL 1.0.0j for Windows [Download-32bit] [Download-64bit]
    (Download the 32bit version if you have a 32bit compiler and the 64bit bit version if you have a 64bit compiler - Do NOT use the light version.)

If you use different PCs for compile/run OregonCore, install one of the following packages on your Server-PC to avoid missing dependencies (depending on your Visual Studio Version and your Server-PC Operating System)

  • Microsoft Visual C++ 2008 Redistributable Package SP1 [x86] / [x64]
  • Microsoft Visual C++ 2010 Redistributable Package [x86] / [x64] / [ia64]


Again:
- For OpenSSL, do NOT use the light version.
- For MySQL, do NOT use the "essential"-version.


PULLING AND COMPILING THE SOURCE

Before you start this phase you should have installed TortoiseHG, Visual Studio, MySQL, and OpenSSL.

Pulling the Source

Create a directory in which Core files will be pulled (for example: C:\OregonCore).

Right-click on the directory and click on 'TortoiseHG' -> 'Clone a Repository'.

Fill in the data as follows:

Source Path: https://bitbucket.org/oregon/oregoncore
Destination Path: C:\OregonCore

Click on 'clone'. Wait a few minutes (or less) and all the files will be pulled in the directory C:\OregonCore.

Configuring and Generating Visual C++ solutions with CMake

In order to avoid possible issues, you cannot build the core in the directory where you have stored the source code. It must be built in a separate directory. In our case, we've placed it in C:\Build (your location could be somewhere else, if you choose for it to be).

Since you have downloaded the required software above, you should have the MySQL / OpenSSL headers and related files already in place and ready to go. If you haven't installed the required software, STOP and do that now.

REMEMBER:

- For OpenSSL, do NOT use the light version
- For MySQL, do NOT use the "essential"-version.

As quoted on the MySQL page :

The Windows "msi-essential-*" installers do not include: Instance Manager tool, Documentation, Development headers etc.

If you have installed the MySQL-Essentials of non-5.1 version then you WILL need to uninstall it and then install the FULL MySQL package.
If you use MySQL server 5.1, you can rely on MySQL files supplied with Trinity Core and even the Essentials package will do.

Similar considerations pertain to OpenSSL vs. OpenSSL Light, but so far OregonCore doesn't provide any OpenSSL files and you really need to AVOID the Light version in any case.

Open the CMake GUI - The window will look similar to this:

CMake-Gui


The two top text areas are used to tell CMake where look for the source tree, and where to put the build files.

Now set the source to where you have checked out the OregonCore sourcecode (in this case C:/OregonCore), and then set the Build directory to where you have created your dedicated folder (in this case C:/Build) using the Browse buttons as in the screenshots.


Setting the Source Directory Setting the Build Directory


When you have set the source and build directories, you can click Configure.
CMake is capable of creating VS6, VS7 + VS7.NET, VS8, VS9 and VS10 solutions and project files.

Configure the Project


Note! CMake is NOT a cross-architecture compiler; it merely generates the build files required for the compiler you choose.
Choose the option for the compiler that you are actually running. STOP and check which one, if you are not sure.

Choose your Compiler


Then click Finish.

Continue with your Compiler Choice


After you click Finish, cmake will process the source code and analyze the CMakeLists.txt for the various source components.
When it has finished, you will see a list of options which need to be confirmed (the red parts).

Confirm Build Options


Go through them and check/uncheck those you want enabled/disabled (you can hover the options to see what they are used for).



IMPORTANT ADDENDUM: There is a new option for creating the dbc/map/vmap utilities, TOOLS. This option is off by default. If you need to extract maps, you should make sure to check the TOOLS option.

Map Tools Option



If you have installed MySQL version other than 5.1, be sure to UNCHECK the WITH_MYSQL_SOURCES option. This tells CMake to look for include files and libraries in your MySQL installation instead of using the MySQL source files provided with OregonCore (which are 5.1.50). Remember, unchecking WITH_MYSQL_SOURCES requires that you have full MySQL package (not Essentials) and that your selected compiler is for the same architecture (32bit/64bit) as your MySQL. If you have 5.1.x, you need not worry - just leave WITH_MYSQL_SOURCES checked.

The text area at the bottom on the cmkae GUI will display important notifications of what the program found while configuring your build.
If there are any errors in the list, check your system to find the proper way to handle them.

Here are the default options:

OregonCore Defaults


Once you have made all of your choices, click Configure again to confirm them.

Confirm Build Options


If CMake finds errors in your configuration, it will return to the confirmation list, with the options displayed in red. Review the notification area, and make whatever changes are called for. If CMake finds no issues, the option area will be white, and you are ready to continue.

Click on Generate, and CMake will create the solutionfiles/projectfiles/makefiles it requires to build for your specific compiler.

Ready to Compile!


When CMake is finished, you will see a messages that says "Generating done". At this point, you are ready to start your compiler and build the core.

Open your build folder, then open the solution file and proceed to the next step - Compiling the Source.

Compiling the Source

Go on the top menu 'Build' and click on Configuration Manager. Make sure you set the build to 'release Win32' or 'release x64' depending on the Operating System OregonCore will be running on and what you have set during CMake configuration.

Warning:  Visual C++ 2008 Express edition does not support the 64 bit platform.  You will need to install the full Visual Studio, as well as additional components to enable 64 bit support.  Refer to Microsoft's website and documentation for more details.
Now go back to the 'Build' menu and click on 'Clean Solution'. Unless you are just testing a compilation, it is always best to clean your build before compiling your new OregonCore revision. Compilation length differs from machine to machine, you should expect it to take 15-30 minutes.

You will find the following message once the compilation has finished successfully:

========== Build: 14 completed, 0 failed, 0 up-to-date, 1 skipped ==========

You will find the freshly compiled binaries in the C:\build\ folder, in this example, as specified during the CMake configuration process.

You will need the following files in order for the core to function properly:

ACE.dll
libeay32.dll
libmySQL.dll
ssleay32.dll
oregoncore.conf.dist
oregon-core.exe
oregonrealm.conf.dist
oregon-realm.exe

Some files might not be there (i.e. libeay32.dll, libmySQL.dll, ssleay32.dll) and so you might have to copy them over from the original installation/bin directories (OpenSSL/MySQL).

Delete any other file which is not in the above list, you will not need them.

Keeping the code up to date

OregonCore Developers are always at work fixing and adding new features to the core. You can always check them here or by using the ToroiseHG View Changelog option.

Simply right-click on your C:\OregonCore folder and click on 'TortoiseHG' -> 'Synchronize'. Click on the button 'pull' at top of the window and it will start pulling the new/updated files. Once it is finished click on 'Update to Branch Tip' at the bottom of the window and you are done! Now you can repeat the compiling procedure above.

It is always best to remove the binaries from the C:\Build\bin folder every time you compile a new revision (and remember to clean your build).



Links

Links to guides and information about building on Windows Platforms

IMPORTANT: These may not be completely correct after Rev 766, but will provide additional background information

Links to configuration information

Essential Reading




You should proceed only if you have successfully compiled the server software.


Continue to Extracting Client Data - DBC/Maps/VMaps -->