Building COHEmu for Windows

Here we speak about Code and Design.
starkravingmad
Posts: 24
Joined: Sun Apr 20, 2008 2:40 am

Post by starkravingmad » Thu Oct 12, 2006 2:58 pm

[b:29763f4554]Building COHEmu for Win32[/b:29763f4554]
The following steps assume that you are using Windows XP. If you are using older versions of windows, some of the steps will change.

[b:29763f4554]Step 1: Install and setup your compiler.[/b:29763f4554]
Download and install Visual C++ 2005 Express (available for free) from the Microsoft website.

Download and install the Microsoft Platform SDK. This is an assortment of libraries needed to build Win32 applications.

Make the SDK work with the compiler (taken from MSDN). Add the paths to the appropriate subsection:

* Executable files: C:\\Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Bin
* Include files: C:\\Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Include
* Library files: C:\\Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Lib

Alternatively, you can update the Visual C++ Directories by modifying the VCProjectEngine.dll.express.config file located in the \\vc\\vcpackages subdirectory of the Visual C++ Express install location. Please make sure that you also delete the file "vccomponents.dat" located in the "%USERPROFILE%\\Local Settings\\Application Data\\Microsoft\\VCExpress\\8.0" if it exists before restarting Visual C++ Express Edition.

One more step is needed to make the Win32 template work in Visual C++ Express. You need to edit the corewin_express.vsprops file (found in C:\\Program Files\\Microsoft Visual Studio 8\\VC\\VCProjectDefaults) and Change the string that reads:

* From: AdditionalDependencies="kernel32.lib"
* To: AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"


[b:29763f4554]Step 2: Build the ACE framework.[/b:29763f4554]
COHEmu is using the Adaptive Communication Environment (ACE) to handle networking, so you will need to download and build ACE before you can build COHEmu. Successfully tested with ACE-5.5.1.

1. Unzip ACE into a directory.
2. In the ACE_wrappers\\ace subdirectory create a file config.h that contains:
#include "ace/config-win32.h"
3. Now open the project ACE_wrappers\\ACE_vc8.sln


[b:29763f4554]Step 3: Download zlib.[/b:29763f4554]
A compression library will be needed to build the final project. Successfully tested with Zlib ver 1.2.3.

[b:29763f4554]Step 4: Download and install Boost.[/b:29763f4554]
Boost contains a set of C++ libraries that is needed to build the final project.
Boost can be obtained from Sourceforge. Successfully tested with Boost 1.33.1.


[b:29763f4554]Step 5: PostgreSQL.[/b:29763f4554]
PostgreSQL is the database management system used in COHEmu to store account and character information. It also contains library files for database communication that is needed to build the final project. Successfully tested with
PostgreSQL ver 8.1.4. Make sure you install Postgre as a service.

Use pgAdmin III to setup your skeleton database (pgAdmin comes with the installation).

* Click File, Add Server
* Use "127.0.0.1" for the address and give it a description to help identify the database.
* Populate the database with the account schema.
*


[b:29763f4554]Step 6: SWIG (optional at this point).[/b:29763f4554]
SWIG is an interface between programming langauges (such as C++) and scripting langauges (such as Python and Ruby). At the time this guide was written, SWIG is not needed to compile the final project.

[b:29763f4554]Step 7: Download and install CMAKE.[/b:29763f4554]
CMAKE is a cross-platform utility used to generate the project files for Visual C++. Successfully tested with CMAKE 2.4.3.

1. Start CMAKE
2. Set the location for source code.
3. Set the location for the output binaries.
4. Click "Configure"
5. Choose "Visual Studio 8 2005" for your compiler and click "OK"
6. Click "Configure" again.
7. Set the paths for ACE, Boost, etc. The following assumes you kept the default paths during installation.
* ACE_lib = \\ACE_wrappers\\lib\\ACEd.dll
* ACE_path = \\ACE_wrappers
* BOOST_path = C:\\Boost\\include\\boost_1_33_1
* PGSQL_lib = C:\\Program Files\\PostgreSQL\\8.1\\lib\\ms\\libpq.lib
* PGSQL_path = C:\\Program Files\\PostgreSQL\\8.1\\include
* SWIG_dir = SWIG_DIR-NOTFOUND
8. Click "OK" to generate cohemu.sln


[b:29763f4554]Step 8: TortoiseSVN.[/b:29763f4554]
TortoiseSVN is a source control program that integrates directly into windows explorer. TortoiseSVN is needed to check out (download) a copy of COHEmu's source code.

[b:29763f4554]Step 9: Finally, build COHEmu.[/b:29763f4554]
Its what we all have been waiting for, and now it is here. [url=svn://trac.cohemu.net/cohemu]Source code[/url] for the project is available here.

** Updated 2006 Oct 13: Fixed link in PostgreSQL section to now point to binary version.

User avatar
nemerle
Posts: 398
Joined: Thu Jan 10, 2013 3:40 pm

Post by nemerle » Thu Oct 12, 2006 3:31 pm

It's a great guide StarkRavingMad :D
Would you mind if I put it on our wiki ?

Oh, and regarding boost, at this point we only use *pool classes, and those don't need compiled version of boost. You just need to tell your compiler where it can find boost's include files. That way you can spare yourself some time ( boost can take ages to compile).
"Ich was in one sumere dale,
in one suthe diyhele hale,
iherde ich holde grete tale
an hule and one niyhtingale."

starkravingmad
Posts: 24
Joined: Sun Apr 20, 2008 2:40 am

Post by starkravingmad » Thu Oct 12, 2006 4:26 pm

[quote:c5a57c83a8=\"nemerle\"]It's a great guide StarkRavingMad :D
Would you mind if I put it on our wiki ?[/quote:c5a57c83a8]

Thank you. Go ahead and put it in the wiki.

User avatar
nemerle
Posts: 398
Joined: Thu Jan 10, 2013 3:40 pm

Post by nemerle » Thu Oct 12, 2006 4:50 pm

Ok. Here's it is https://trac.cohemu.net/wiki/VisualCompilingHowTo if you'd like to change or update anything in there, just let me know.
"Ich was in one sumere dale,
in one suthe diyhele hale,
iherde ich holde grete tale
an hule and one niyhtingale."

sithguy
Posts: 4
Joined: Sun Mar 19, 2006 3:49 pm

Post by sithguy » Thu Oct 12, 2006 8:11 pm

So what do we need to change for those of us running 2000?

User avatar
nemerle
Posts: 398
Joined: Thu Jan 10, 2013 3:40 pm

Post by nemerle » Thu Oct 12, 2006 8:21 pm

Please try to follow this guide, if you encounter any problems, post them here.
This way we will be able to extend the guide to cover w2k.
"Ich was in one sumere dale,
in one suthe diyhele hale,
iherde ich holde grete tale
an hule and one niyhtingale."

z3r0b347
Posts: 21
Joined: Sat Sep 23, 2006 9:37 pm

Post by z3r0b347 » Thu Oct 12, 2006 8:23 pm

Great work with the guide, im sure many will find this extremely useful

coxemu_forgotten_user
Posts: 150
Joined: Thu Jan 01, 1970 12:00 am

Post by coxemu_forgotten_user » Fri Oct 13, 2006 3:23 pm

So how the hell you install postgresql? there is a file called INSTALL but its just a file :S

starkravingmad
Posts: 24
Joined: Sun Apr 20, 2008 2:40 am

Post by starkravingmad » Fri Oct 13, 2006 4:13 pm

[quote:d3e8516c3c=\"jhon\"]So how the hell you install postgresql? there is a file called INSTALL but its just a file :S[/quote:d3e8516c3c]

Oops. The link in the guide points to the source. Try this one instead. It should point to the binary directory. Get the postgre-8.1.4-1.zip, that should have an installer with it.

coxemu_forgotten_user
Posts: 150
Joined: Thu Jan 01, 1970 12:00 am

Post by coxemu_forgotten_user » Fri Oct 13, 2006 6:18 pm

great ty mate :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest