PDA

View Full Version : How To: Compile Using Microsoft VS .NET


Cans
12-30-2004, 01:03 PM
This tutorial covers how to compile the EQEmulator source into EmuShareMem.dll, Zone.exe, and World.exe using VS.net.

First, what you need:

1) Microsoft Visual Studio .NET - In this tutorial, I am using the 2003 version.
2) EQEmu Source Code
3) MySQL Installed
4) Perl Installed (if you want Perl)
5) Zlib

**Note: I will be using C:\EQEmu\ as my EQEmulator directory. Be sure to change this if yours is in a different location!**

----

Setting Up:

1) VS .net

Purchase at a store.

2) EQEmu Source Code

As of now, I believe the easiest way to get the latest Source Code is through Anonymous CVS.

To get the source through this, open up a command prompt and type in

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/eqemulator login

When it asks for you to log in, don't type in anything and just hit Enter. Then, type in

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/eqemulator co EQEmuCVS

Once you do that, it will log into the server and begin downloading the source files. It should put the files to C:\EQEmuCVS\.

3) MySQL Installed

Go here (http://dev.mysql.com/get/Downloads/MySQL-4.0/mysql-4.0.22-win.zip/from/pick#mirrors) and download MySQL. You should have this in already if you are compiling source, but just incase you don't, there it is. It should default to install in C:\MySQL\.

4) Perl Installed

If you don't want Perl on your system, and want nothing to do with it whatsoever, skip this step, and all steps dealing with Perl.

Get Perl 5.8 (http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.2.808-MSWin32-x86.msi) and NMAKE.EXE (http://home.comcast.net/~molimo140/NMAKE.EXE).

Once downloaded, install Perl. Once installed, put NMAKE.exe in your perl\bin folder (default is C:\perl\bin). Next, open up a command prompt and type

perl -MCPAN -e shell

Say no when it asks to configure manually.

Once it is done, type in

install IO::Scalar

When this is done, there should be an '-- Install OK'. If so, then the installation was successful.

Zlib

Download Zlib (http://www.zlib.net/zlib121-dll.zip), and extract it to your Emu directory.

Set Up - Part 2

Now that you have downloaded and installed everything, we are going to put everything in a similar location.

1) Take the source from the Anonymous CVS download and put it in your main EQEmu directory. For mine, it would be C:\EQEmu\source.

2) Copy the entire MySQL folder which was installed to your main EQEmu Directory. For mine, it would be C:\EQEmu\mysql.

3) If you are working with Perl, also move that directory into your EQEmu Directory. For mine, it would be C:\EQEmu\Perl.

----------------

Compiling Program Set Up:

1) Open up VS .NET.

2) Select Tool -> Options...

3) Click on the Folder 'Projects' and then click the sub-selection 'VC++ Directories'.

http://www.angelfire.com/ab7/gsig/directories.jpg

4) From that window, select Include Files, under the 'Show Directories For'.

--Add the following lines:

C:\EQEMu\MySQL\include
C:\EQEmu\zlib
C:\EQEmu\zlib\include

Replace C:\EQEmu with your EQEmu directory path. If you don't, it will not work.

5) Next, go back the the 'Show Directories For' and select Library Files.

--Add the following lines:

C:\eqemu\mysql\lib\opt
C:\eqemu\mysql\lib

Again, replace C:\EQEmu with your EQEmu directory path. If you don't, it will not work.

6) Once done, click 'Ok' to close the window.

-----------

Compiling EmuShareMem.dll

1) Go to File -> Open -> Project...

2) Target your source\EmuShareMem\ folder in your Emu directory. Type in 'EmuShareMem.dsw' and click open. If it asks you to convert, click 'Yes To All'.

http://www.angelfire.com/ab7/gsig/yestoall.jpg

3) Next, go to Buld -> Configuration Manager...

4) Under 'Active Solution Configuration:', select Release.

http://www.angelfire.com/ab7/gsig/activeconfig.jpg

5) Click 'Close' to close the window.

6) Go to Build -> Build EmuShareMem

7) Wait. This shouldn't take extremely long on an average computer. When it finishes, you should get:

http://www.angelfire.com/ab7/gsig/emusharemem.jpg

-----------

Compiling World.exe

1) Go to File -> Close Solution.

2) Go to File -> Open -> Project...

3) Target your source\World\ folder in your Emu directory. Type in 'world.dsw' and click open. If it asks you to convert, click 'Yes To All'.

4) Go to Buld -> Configuration Manager...

5) Under 'Active Solution Configuration:', select Release.

6) Click 'Close' to close the window.

7) Go to Build -> Build World

8) Wait for it to compile. This one takes longer than EmuShareMem, but still not a very long time. When finished, it should look like:

http://www.angelfire.com/ab7/gsig/world.jpg

-----------

Compiling Zone.exe - Without Perl

1) Go to File -> Close Solution.

2) Go to File -> Open -> Project...

3) Target your source\Zone\ folder in your Emu directory. Type in 'zone.dsw' and click open. If it asks you to convert, click 'Yes To All'.

4) Go to Buld -> Configuration Manager...

5) Under 'Active Solution Configuration:', select Release.

6) Click 'Close' to close the window.

7) Go to Build -> Build World

8) Wait for it to compile. I find this one takes the longest to compile, simply because it has a lot to do. Just sit back, take a bathroom break, and come back..It'll finish. When it is done, you should see:

http://www.angelfire.com/ab7/gsig/zone.jpg

-----------

Compiling Zone.exe - With Perl

1) Go to File -> Close Solution.

2) Go to File -> Open -> Project...

3) Target your source\Zone\ folder in your Emu directory. Type in 'zone.dsw' and click open. If it asks you to convert, click 'Yes To All'.

4) Go to Build -> Configuration Manager....

5) Select from 'Active Solution Configuration', '<New...>'.

6) In the new window, type in 'Perl' for the Solution Configuration Name, and 'Copy Settings From' -> Release. Also, be sure the box is checked.

http://www.angelfire.com/ab7/gsig/nsc.jpg

7) Click 'Ok', and then 'Close'.

8) Now go to 'Project -> Properties...'.

9) Go to the C/C++ folder and select the General sub-selection.

10) In this window, go to the 'Additional Include Directories', and type in:

c:\eqemu\perl\lib\core

http://www.angelfire.com/ab7/gsig/aid.jpg

11) Next, go to the sub-selection 'Preprocessor' and go to the line 'Preprocessor Definitions'. On this line, add to the end of everything:

,EMBPERL,EMBPERL_PLUGIN

http://www.angelfire.com/ab7/gsig/preprocessor.jpg

12) Now, go to the Linker folder, and select the 'General' tab. In this window, go to the 'Additional Library Directories' line, and type in:

c:\eqemu\perl\lib\core

http://www.angelfire.com/ab7/gsig/linker.jpg

13) Click 'Apply', and the 'Ok' to close the window.

14) Go to Project -> Add Existing Item...

15) Type in the 'File name:' box: emb*.*

16) Select all files that come up, and click on 'Open'.

http://www.angelfire.com/ab7/gsig/emb.jpg

17) Go back to the 'Add Existing Item...' and type in 'perl*.*' this time. Select all files which come up and click Open.

http://www.angelfire.com/ab7/gsig/perl.jpg

18) Go to Build -> Build Zone

19) Wait for it to compile. When it is done, you should see:

http://www.angelfire.com/ab7/gsig/zoneperl.jpg

-----------

For Minilogin:

1) If you want to play using MiniLogin, first download it here (http://www.linkups.placida.fu8.com/MiniLogin6.0.zip).

2) Now, log into your MySQL database and insert the following commands:


INSERT INTO variables (varname, value, information) VALUES ('LoginType', 'Minilogin', 'Set this to Minilogin to login using a minilogin server :)');

alter table account add minilogin_ip varchar(32) not null;

insert into account (name,status, minilogin_ip) values('USERNAME_HERE',250,'127.0.0.1');


Replace USERNAME_HERE with your username.

3) Open up MiniLoginAccounts.ini (in your MiniLogin directory) and make it look like:


# Max 200 lines total (including comments and blank lines)
# Blank lines may mess up the line # reported in error messages
127.0.0.1 USERNAME_HERE PASSWORD_HERE


Replacing the USERNAME_HERE and PASSWORD_HERE for your Username and Password. Note: The username you inserted into the MySQL command must be this username as well! Also, make sure you lave one space after your password.

4) Next, in your LoginServer.ini put '127.0.0.1' or 'localhost' in the loginserver and worldaddress fields, and put the loginport to 5999.

Also, make sure this is in there as well:


[LoginConfig]
ServerMode=MiniLogin
ServerPort=5999


5) Change your EQHost.txt file to:


[LoginServer]
Host=127.0.0.1:5999


6) Edit your Boot5Zones.bat file and put 127.0.0.1 or localhost in for BOTH of the IP addresses.

7) Launch MiniLogin.exe, then World.Exe, and then Boot5zones.bat. When everything is loaded, you can login using the username and password you entered in before.

------

Now you should have all three files compiled (EmuShareMem.dll, Zone.exe, and World.exe) and MiniLogin set up for you if you wanted it.

All three of the compiled files can be found in the C:\EQEmuDirectory\source\build directory.

And there you have it! If you have any questions, feel free to E-Mail or PM me. I'll see if I can compile a FAQ type thing.

Edit: Added in MiniLogin section per request of Muuss :)

Kaiyousei
03-04-2005, 11:35 AM
Your link for the Zlib download is no longer correct because the latest release version is 1.2.2 rather than 1.2.1... you might consider updating the link to either reflect this change or simply to direct people to the main web page so that they can find the download regardless of version.

Kaiyousei

Cisyouc
03-04-2005, 04:39 PM
If you're having issues with IO::Scalar, you can not include EMBPERL_PLUGIN in your definitions. You will still have quests, but you wont have the rarely used plugin.pl.

Cans
03-16-2005, 02:45 PM
I can't seem to update my post because i have more than 10000 characters plus i have images and such being linked. Hopefully people will just realize to just go to the Zlib homepage.