Skip to content

Commit 5462d43

Browse files
committed
Convert some of the "Setup" section pages to markdown
this was done automatically with pandoc, page formatting may still be broken in some parts
1 parent adca37b commit 5462d43

17 files changed

+1985
-1367
lines changed

docs/setup/compiling-windows.md

Lines changed: 66 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,69 @@
22

33
For compiling on Windows, Visual Studio is the preferred method, although using Cygwin is also possible.
44

5-
=== Using Visual Studio ===
6-
[[Image:Compile_hercules.PNG|thumb|300px|MS Visual Studio 2012: Compile configuration (<span style="color:red;">red</span>) and solution (<span style="color:blue;">blue</span>) with it's child projects.]]
7-
Hercules ships with solution and project files for Visual Studio from 2012 onwards.
8-
* Download the latest version of [https://www.visualstudio.com Visual Studio] (at the time of writing, MS Visual Studio 2015 Community Edition) and install it, if you do not have Visual Studio already installed.
9-
* Open '''Hercules-14.sln''' in your Hercules folder if you use Visual Studio 2015, for Visual Studio 2013, you need to open '''Hercules-12.sln''', for Visual Studio 2012, you need to open '''Hercules-11.sln''' instead.
10-
* Select the desired compile configuration (marked <span style="color:red;">red</span>). Use '''Release''' when you compile the server, where players will be playing on. '''Debug''' compiles the server without optimizations and with debugging information.
11-
* Right-click the solution node (marked <span style="color:blue;">blue</span>) and select '''Build solution'''. If you have compiled the server before, it is recommended to use '''Rebuild solution''', as it forces the compiling of all components, not just those, which seem to have changed since last compile.
12-
* If the compilation was successful, the resulting executables are in the same folder as the solution named ''login-server.exe'', ''char-server.exe'', ''map-server.exe'' and ''mapcache.exe''.
13-
14-
=== Using Cygwin ===
15-
[http://www.cygwin.com/ Cygwin] is a POSIX compatibility layer for Windows. As such it enables compiling the way it would be done on Linux. Compiling in Cygwin is '''not recommended''' due to lower performance and increased installation complexity.
16-
17-
* Download [http://www.cygwin.com/setup.exe Cygwin] and install it, if not already done so. When installing, select following packages:
18-
** from ''Devel'': ''cmake'', ''gcc'' and ''make''
19-
** from ''Lib'': ''libidn-devel'', ''libpcre-devel'', ''readline'', ''zlib-devel''
20-
* Running Cygwin Terminal will create folder <code>'''home/user'''</code> inside Cygwin installation folder, where ''user'' is the name currently logged on Windows user.
21-
* SQL server needs to be installed in Cygwin so the compiler can access the SQL libraries. Download the .tar.gz archive from the [http://dev.mysql.com/downloads/mysql/?current_os=src MySQL website], such as '''mysql-5.5.20.tar.gz'''.
22-
* Place the archive into <code>'''/home/user'''</code> and execute following inside Cygwin Terminal to unpack it:
23-
cd ~
24-
tar xvzf mysql-5.5.20.tar.gz
25-
* Navigate to directory with unpacked archive:
26-
cd mysql-5.5.20
27-
* To avoid conficts, replace ''dtoa()'' with ''_dtoa()'' in ''strings/dtoa.c'' file:
28-
sed -i 's/dtoa(/_dtoa(/g' ./strings/dtoa.c
29-
* Build MySQL with following commands:
30-
cmake .
31-
make mysqlclient libmysql
32-
make install
33-
* After everything completes, Cygwin is ready for compiling Hercules. Navigate to the Hercules folder in Cygwin. Windows drives are accesible as <code>/cygdrive/x</code> where ''x'' is the letter assigned to the drive by Windows.
34-
* Execute following commands inside Hercules folder to compile it:
35-
./configure --with-mysql=/usr/local/mysql/bin/mysql_config
36-
make sql
37-
* If the compilation was successful, the resulting executables are in the Hercules folder named ''login-server_sql.exe'', ''char-server_sql.exe'' and ''map-server_sql.exe''.
38-
* Server executables can be run inside Cygwin Terminal or directly, but in this case you need to copy required libraries to Hercules folder:
39-
** ''cygwin1.dll'', ''cygz.dll'', ''cyggcc_s-1.dll'', ''cygpcre-0.dll'' from <code>/bin</code>
40-
** ''cygmysqlclient-18.dll'' from <code>/usr/local/mysql/lib</code>
5+
### Using Visual Studio
6+
7+
<img src="Compile_hercules.PNG"
8+
title="MS Visual Studio 2012: Compile configuration (red) and solution (blue) with it&#39;s child projects." width="300"
9+
alt="MS Visual Studio 2012: Compile configuration (red) and solution (blue) with it&#39;s child projects." /> Hercules
10+
ships with solution and project files for Visual Studio from 2012 onwards.
11+
12+
- Download the latest version of [Visual Studio](https://www.visualstudio.com) (at the time of writing, MS Visual Studio
13+
2015 Community Edition) and install it, if you do not have Visual Studio already installed.
14+
- Open **Hercules-14.sln** in your Hercules folder if you use Visual Studio 2015, for Visual Studio 2013, you need to
15+
open **Hercules-12.sln**, for Visual Studio 2012, you need to open **Hercules-11.sln** instead.
16+
- Select the desired compile configuration (marked <span style="color:red;">red</span>). Use **Release** when you
17+
compile the server, where players will be playing on. **Debug** compiles the server without optimizations and with
18+
debugging information.
19+
- Right-click the solution node (marked <span style="color:blue;">blue</span>) and select **Build solution**. If you
20+
have compiled the server before, it is recommended to use **Rebuild solution**, as it forces the compiling of all
21+
components, not just those, which seem to have changed since last compile.
22+
- If the compilation was successful, the resulting executables are in the same folder as the solution named
23+
*login-server.exe*, *char-server.exe*, *map-server.exe* and *mapcache.exe*.
24+
25+
### Using Cygwin
26+
27+
[Cygwin](http://www.cygwin.com/) is a POSIX compatibility layer for Windows. As such it enables compiling the way it
28+
would be done on Linux. Compiling in Cygwin is **not recommended** due to lower performance and increased installation
29+
complexity.
30+
31+
- Download [Cygwin](http://www.cygwin.com/setup.exe) and install it, if not already done so. When installing, select
32+
following packages:
33+
- from *Devel*: *cmake*, *gcc* and *make*
34+
- from *Lib*: *libidn-devel*, *libpcre-devel*, *readline*, *zlib-devel*
35+
- Running Cygwin Terminal will create folder **`home/user`** inside Cygwin installation folder, where *user* is the name
36+
currently logged on Windows user.
37+
- SQL server needs to be installed in Cygwin so the compiler can access the SQL libraries. Download the .tar.gz archive
38+
from the [MySQL website](http://dev.mysql.com/downloads/mysql/?current_os=src), such as **mysql-5.5.20.tar.gz**.
39+
- Place the archive into **`/home/user`** and execute following inside Cygwin Terminal to unpack it:
40+
41+
` cd ~`
42+
` tar xvzf mysql-5.5.20.tar.gz`
43+
44+
- Navigate to directory with unpacked archive:
45+
46+
` cd mysql-5.5.20`
47+
48+
- To avoid conficts, replace *dtoa()* with *\_dtoa()* in *strings/dtoa.c* file:
49+
50+
` sed -i 's/dtoa(/_dtoa(/g' ./strings/dtoa.c`
51+
52+
- Build MySQL with following commands:
53+
54+
` cmake .`
55+
` make mysqlclient libmysql`
56+
` make install`
57+
58+
- After everything completes, Cygwin is ready for compiling Hercules. Navigate to the Hercules folder in Cygwin. Windows
59+
drives are accesible as `/cygdrive/x` where *x* is the letter assigned to the drive by Windows.
60+
- Execute following commands inside Hercules folder to compile it:
61+
62+
` ./configure --with-mysql=/usr/local/mysql/bin/mysql_config`
63+
` make sql`
64+
65+
- If the compilation was successful, the resulting executables are in the Hercules folder named *login-server_sql.exe*,
66+
*char-server_sql.exe* and *map-server_sql.exe*.
67+
- Server executables can be run inside Cygwin Terminal or directly, but in this case you need to copy required libraries
68+
to Hercules folder:
69+
- *cygwin1.dll*, *cygz.dll*, *cyggcc_s-1.dll*, *cygpcre-0.dll* from `/bin`
70+
- *cygmysqlclient-18.dll* from `/usr/local/mysql/lib`

0 commit comments

Comments
 (0)