Suggestion for additional documentation

Made a small change or new addition to the POL Core that makes a difference? You can post the changes here in .patch or .diff file format, for our Dev team to screen and apply to the SVN!

Moderator: POL Developer

Locked
Yukiko
Distro Developer
Posts: 2506
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Suggestion for additional documentation

Post by Yukiko » Sat Jun 11, 2011 9:16 pm

I suggest that these instructions for compiling under Windows be added to the Core docs area. This was taken from the thread at the following link: http://forums.polserver.com/viewtopic.php?f=20&t=3414
This is for Visual C++ 2008 Express. You need the installation and probably a Windows SDK. I am working under Windows XP SP3. If you have a full edition of Visual Studio 2008 this is also fine, but its not free. MSVC 2008 Express is free.

Step 1:
Use SVN to fetch the latest core revision (318, while I write this).

Open a CMD-Window with the entry 'Visual Studio 2008 Command Prompt", which you will find under the program start menu, it should be under Microsoft Visual Studio 2008..../Tools. This is important, since you want the environment from VC 2008!
Go to the folder .../polserver/trunk/lib/STLPort5, where you installed the sources.
Now look into this folder, you should find a file configure.bat.
Use and type in the command shell:
configure msvc9 --extra-cxxflag "/D_WIN32_WINNT=0x0501"

The option --extra-cxxflag is optional, it tells, that your lowest Operating System is Win2000/XP.
If you are curious, type configure --help before that.

If this step succeeds it says 'go to build/lib....'. Do it, and type
nmake clean install
This runs for 2 minutes, then you have the STLPort library (you need the static lib).

Close the command window.

Turley added that the whole step 1 can be replaced with the calling of one of the batchfiles:
build-msvc9-x64.bat
build-msvc9-x86.bat
build-msvc10-x64.bat
build-msvc10-x86.bat
...
msvc9 is for vs2008 and msvc10 for vs2010

Step 2:
Start up MSVC 2008, go to
.../polserver/trunk/pol-core.

Open pol-2008.sln as solution with MSVC 2008. Do NOT open any other of the files, or VC will spam you with conversions and fill your folder with stuff.
You should see a project folder with several projects.

Step 3: (Only for MSVC 2008 Express)
You can skip this step, if you have a full version of MSVC 2008 instead of the Express edition, which is free.
Now you have to change at least these files, or the build will fail:
.../polserver/trunk/pol-core/ecompile/ecompile.rc
.../polserver/trunk/pol-core/pol/pol.rc
.../polserver/trunk/pol-core/uoconvert/uoconvert.rc

All you need to do is replace exactly one line
#include "afxres.h"
in each of these files. The reason is, that MSVC 2008 Express comes without the MFC library, which you do not need anyway. So you do not have the file afxres.h. Replace one line in every of the 3 files with these 3 lines

//#include "afxres.h"
#include <windows.h>
#define IDC_STATIC (-1)

I.e. you comment the include of afxres.h and replace it with the next two lines. Ignore the other text in these files, even if there are other strings named afxres. (This fix can be googled on the Internet, using the search string Visual Studio Express afxres.h or similar).
If you have a full edition of Visual Studio the previous step is not needed.

Step 4:
Now in MSVC 2008 make sure you select 'Release' instead of 'Debug'. Debug is default so you have to change it. You want to build a Win32 Release.
Next right click on the project map an build it. It should build all, including the tools (ecompile, uoconvert, etc). There will be several warnings, but no errors.
Thats all!

Step 5: (optional)
There is a folder
.../polserver/trunk/pol-core/dist
which can be used to build a distribution, but this step is not necessary. You can collect the items yourself. If you want to use it, look at the file makefile.vc. You have to change it, if you do not have Winzip. Its rather simple. To build the distro right click on the entry 'dist' in your project map view and build it.

Or you collect the files yourself: There are 'Release folders in all the folders for the several parts, the pol core can be found under
.../polserver/trunk/pol-core/pol/Release
and so on.
Do not forget to collect the *.em files, and the core-changes.txt from the folder
.../polserver/trunk/pol-core/support

Thats all. I have scripts ready for 0.98.2, and they run unchanged under the newest core rev 318. If you want to try it, do not forget to use the new ecompile to compile all your scripts and use the new uoconvert to remake your realms.
Then pol should start normally and be usable.
With my first compile experiment (after much cursing and fiddling around, I was unsure with pol-xxxx.sln to use) I had a core crash after start, (assertion with a script) but using an older ecompile (from POL 0.99 lates official beta) fixed it. I then refetched the rev 318, and did a clean compile of both the STLPort5 and POL, and the crash was never seen again.

I am sure that several steps are not optimal - maybe somebody can comment? But it works for me...

OWHorus
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

xeon
Forum Regular
Posts: 333
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy
Contact:

Re: Suggestion for additional documentation

Post by xeon » Sun Jun 12, 2011 11:54 am

Definitively.
8)
Scripter Xeon | Zulu Hotel Italia 7th Age | www.zhi.it
Image

RusseL
Forum Regular
Posts: 349
Joined: Fri Feb 20, 2009 8:30 pm

Re: Suggestion for additional documentation

Post by RusseL » Sun Jun 12, 2011 3:25 pm

I think 'sticky' post is enough

Locked