Versiones comparadas

Clave

  • Se ha añadido esta línea.
  • Se ha eliminado esta línea.
  • El formato se ha cambiado.
Comentarios: Minor spell check corrections for readability. Removed "How-to_" from links to the basic guide.

Tabla de contenidos

Introduction

This guide is directed to towards advanced windows users which Windows users who, for some reason, want to use GCC instead of Visual Studio to build TC for some reason. Regular users should build TC using the basic guide, as using GCC has no benefit for them over the VS sollutionsolution. Therefore this guide won't provide step-by-step instructions most of the time. This guide only covers only compiling the sourcecode, for source code. For other steps about setting up your trinitycore instalation TrinityCore installation, please refer to the How to: windows Windows guide.

Preparation

To successfuly To successfully build TC with mingw GCC toolchain you need (in addition to requirements from the basic guide):

  • MinGW - there are several MinGW distributions around the Net, this guide uses http://www.mingw.org/ , which outputs only 32 bit code. Please install your favourite distro according to the documentation provided with it. For mingw.org the documentation is here: http://www.mingw.org/wiki/Getting_Started .
  • MSYS - it's a convenient bash shell for windows, please follow follow the install guide for details.

Libraries for MinGW

LibmysqlThe libmysql.lib file provided with mysql your MySQL installation cannot be used by the MinGW GCC toolchain, because GCC expects libraries with the '.a' format. The simplest way to fix the problem is to convert the .lib file provided with your install. You can do that by doing the following in MSYS:

Panel
titleInside MSYS shell please do:

cd /to/your/mysql/install/directory

cd lib/opt

reimp.exe -d libmysql.lib
dlltool.exe -k -d libmysql.def -l libmysql.a
Nota
titleNote

If your mingw installation does not provide reimp or dlltool, you need to download them, from for example from here.

Advertencia

If you are getting errors with the reimp command, you may need to rebuild the mingw-utils-0.4-1 package from source , as the binary distribution contains a bug.

Build

Once you have done the previous steps, you can proceed to build the code:

Panel

cd /to/directory/you/want/to/build/in #building in the trinitycore source dir is not advised

#the following should be in a single command (1 line)

cmake -G"MSYS Makefiles" -DUSE_COREPCH=0 -DUSE_SCRIPTPCH=0 #build with PCH enabled is not supported

-DUSE_MYSQL_SOURCES=0 -DMYSQL_INCLUDE_DIR=[/path/to/mysql/distribution/]/include -DMYSQL_LIBRARY=[/path/to/mysql/distribution/]/lib/opt/libmysql.a # path to include dir of your mysql distro and to libmysql.a you just created

-DCMAKE_INSTALL_PREFIX=/where/you/want/to/put/installed/tc

/path/to/trinitycore/dir

#end of cmake command

make # this will take a (long) while

make install # this will install the software in your prefered dirpreferred directory. Afterwards, you can run 'make uninstall' to remove and make clean to purge build dirdirectory.

Running the core

Executables were built with dependencies on mingw, so you need to make sure to add mingw/bin dir to your PATH variable. Also, remember to copy the libmysql.dll file to the install dirdirectory, or add it to the PATH aswellas well.