Pulling, Compiling and Keeping the Source Up-to-Date

Introduction

Before you get scared by this long guide, we assure you the procedure is quite simple. Most of the following steps are to be performed only the first time you install Trinity and only the Trinity updating procedures will need to be run from time to time.

Required Software

See TrinityCore Requirements

Pulling & Compiling the Source

Pulling the Source

  1. Create a directory in which Core files will be pulled (for example: C:\Trinity).
  2. Right-click on the directory and click on Git Extensions -> Clone.
  3. Fill in the data as follows:

Repository to clone: https://github.com/TrinityCore/TrinityCore
Destination: C:\Trinity
Subdirectory to create: <none>
Branch: 3.3.5
Personal Repository: Yes

Note: Depending on which branch you want to compile, change the name of the branch accordingly. i.e. 3.3.5/4.3.4/6.x

Click Clone. Within a few minutes all of the TrinityCore source files will be pulled into the directory C:\Trinity.

Configuring and generating Visual C++ solutions with CMake

Before you begin, create an empty directory called Build. In this example, we will use D:\Build.

Note: If CMake do not recognize C/C++ compiler, choose Specific Native Compiler, and choose path to target vcvarsall.bat, e.g. C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat

  1. Click Browse Source... -> Select 
    the source directory (C:/Trinity)

2. Click Browse Build... -> Select
the build directory (D:/Build)

3. Click Configure

4. Make sure Use default native
compilers is checked

5. In the drop-down menu, choose the
version of the compiler you downloaded
in the Software Required section .

6. Click Finish.

7. Make sure Tools is checked. This will
compile the map extractors needed later
in the setup. 

8. Click Configure again.

9. Click Generate. This will install the
selected build files into your D:/Build folder.

Note: If MySQL is not found by CMake it is required to set MYSQL_INCLUDE_DIR = C:/mysql_libs/include and MYSQL_LIBRARY= C:/lib_XX/libmysql.lib.
XX depends if you are compiling in 32 or 64 bits mode. (See the 9th point of the Windows requirement list in TrinityCore Requirements.)

Note 2: If you get linker errors (e.g "error LNK2019: unresolved external symbol mysql_server_init"), make sure MYSQL_LIBRARY is set to the version that matches your compile mode (x64 vs 32 bits).

(If you do not see the MYSQL fields in CMake, tick the Advanced box).

Compiling the Source

  1. Browse into your D:\Build folder and open TrinityCore.sln with Visual C++ Express.
  2. On the menu at the top, click Build and select Configuration Manager.
  3. Set Active Solution Configuration to Release
  4. In the list menus below "Help", set Active Solution Platform to Win32 (if you set 64-bit compilation during the CMake configuration, select Win64)
    click Close (settings get saved instantly).
  5. Right-click ALL_BUILD in the Solution Explorer on the left sidebar and select Clean.
    (on some VS2013 versions, click the Build menu and select  Clean  Solution.)
  6. Right-click ALL_BUILD and select Build.
    1. Compilation length differs from machine to machine, you should expect it to take 5-30 minutes.
    2. If you are asked to "Reload build files" during the compile, do so.
    3. When the build is complete, you will find a message similar to the one below (the numbers may be different).
========== Build: 22 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

 

You will find your freshly compiled binaries in the C:\Build\bin\release folder. These are all used to run your server at the end of this instruction.

You will need the following files in order for the core to function properly. These will all be located in your C:\Build\bin\release folder:

libeay32.dll
libmySQL.dll
ssleay32.dll
worldserver.conf.dist
worldserver.exe
authserver.conf.dist
authserver.exe

There are a few DLLs that needs to be manually added to this folder, and you need to copy them over from the following installation/bin directories:

libmySQL.dll - C:\Program Files\MySQL\MySQL Server 5.x\lib
libeay32.dll, ssleay32.dll - C:\OpenSSL-Win32\bin

libzmq-v120-mt-4_0_4.dll - C:\Program Files\ZeroMQ 4.0.4\bin

Keeping the Source Up-to-Date

TrinityCore Developers are always at work fixing and adding new features to the core. You can always check them here, or by viewing them from within Git Extensions.

  1. Open your TrinityCore repository in GitExtensions.
    1. Click on the blue arrow
    2. In the new window, click Pull.
  2. This will sync your local repo to the latest commits from the branch you have setup as default.
  3. Now you will need to re-run CMake Configure & Generate to update your SLN files.
  4. Compile
  5. ??
  6. Profit!!

 

Next - Configuring your databases

 

Attachments:

Step1.png (image/png)
Step2.png (image/png)
Step3.png (image/png)
Step4.png (image/png)
Step6.png (image/png)
Step7.png (image/png)
Step8.png (image/png)
Step9.png (image/png)
Step10.png (image/png)
Step5.png (image/png)
image2014-2-24 20:2:16.png (image/png)
image2014-2-24 20:5:2.png (image/png)
image2014-2-25 16:19:52.png (image/png)
image2014-3-19 23:9:54.png (image/png)

Comments:

Database Installation seems to be broken. I'm not able to edit anything to correct it. King Pin?

Posted by guybrush at Apr 11, 2013 08:37

Updated with temporary guide.

Posted by guybrush at Apr 15, 2013 16:51

Andddddd it's fixed. Thanks KP

Posted by guybrush at Apr 19, 2013 19:03

Do method work apply for Windows 8.1 or do i need to download the latest version to compile the server?

 

Posted by amalrajkumar at Jul 18, 2014 15:20

Not sure what you said but basically it's the same procedure on Windows 8.1.

Posted by nayd at Jul 18, 2014 15:53

Do i need to install Microsoft Visual Studio Express 2013  for Windows Desktop to compile  trinitycore fpr windows 8.1 or is it possible to use older version of visual studio express? 

Posted by amalrajkumar at Oct 17, 2014 16:27

Yes, 2013 is required.

Posted by nayd at Oct 17, 2014 22:28

So its not possible for me to compile using visual studio 2012 or previous versions

Posted by amalrajkumar at Oct 18, 2014 01:33

I am having trouble "Pulling the source" when I follow the directions above I get the following error from Git Extensions  :

"C:\Program Files\Git\bin\git.exe" clone -v --recurse-submodules --progress --branch master "https://github.com/TrinityCore/TrinityCore.git" "C:/Trinity"

Cloning into 'C:/Trinity'...

fatal: Remote branch master not found in upstream origin

Unexpected end of command stream

Done

 

 

Can anyone help, I am trying to do a 3.3.5 build.

 

Thanks

Posted by drkoontz at Oct 23, 2014 18:56

Instead of "--branch master" you need to do "--branch 3.3.5".

Posted by nayd at Oct 23, 2014 18:58

Thank you for the fast response........ this seems to be working now (smile)

Posted by drkoontz at Oct 23, 2014 19:06

10/25 - Updated to reflect branch changes (3.3.5/4.3.4/6.x)

Posted by stryker at Oct 24, 2014 18:21

Getting 106 Errors concerning MySQL during the BUILD process.

Haven't had any errors during previous steps.

The errors are mostly LNK2019 for both worldserver and authserver.

Error 48 error LNK2019: unresolved external symbol _mysql_server_init@12 referenced in function "public: static void __cdecl MySQL::Library_Init(void)" (?Library_Init@MySQL@@SAXXZ) D:\Build\src\server\worldserver\Main.obj worldserver

 

Also a MSB3073:

Error 106 error MSB3073: The command "setlocal
"C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 132 5 INSTALL

Not sure how to resolve these, so would appreciate some inputs (smile)

Posted by slopeh at Nov 04, 2014 19:50

Quoting from this exact page:

Note 2: If you get linker errors (e.g "error LNK2019: unresolved external symbol mysql_server_init"), make sure MYSQL_LIBRARY is set to the version that matches your compile mode (x64 vs 32 bits).

Posted by nayd at Nov 04, 2014 19:54

wow. Thanks for the quick reply.

I'm not exactly sure where I do that. I have x86-versions installed of everything.

Posted by slopeh at Nov 04, 2014 20:01

In the cmake GUI, tick Advanced and then change MYSQL_LIBRARY to the correct value.

This page and TrinityCore Requirements has all the info you need.

Posted by nayd at Nov 04, 2014 21:21

Seems cmake linked up an old MS MySQL x64 version. Now the LNK-errors are fixed, still have the MSB3073 error.

Error 1 error MSB3073: The command "setlocal

"C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 132 5 INSTALL

 Thanks alot for the help (smile)

Edit: Saw this was for the "INSTALL" project in Visual Studio.. At the configuration manager, the INSTALL project is by default unchecked. Does that mean I should exclude it from the build?

Saw on the screen shots here, that there were no skipped projects, hence I included that one as well.

Posted by slopeh at Nov 04, 2014 22:12

No, you do not have to enable it.

(That is why I want to remove screenshots from the wiki and switch to console based guide, people get too focused on them. (smile))

Posted by nayd at Nov 04, 2014 22:39