compiling under windows

Here you can post threads specific to the current release of the core (099)

Moderator: POL Developer

Post Reply
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

compiling under windows

Post by RusseL »

can anybody upload a little manual how to compile the lastest svn-core under windows?
OWHorus
Grandmaster Poster
Posts: 105
Joined: Sat Feb 04, 2006 1:24 pm
Location: Vienna, Austria

Re: compiling under windows

Post by OWHorus »

Hello,

I just started playing around some days ago, here are my hints - but not a manual for sure :-)

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.

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
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: compiling under windows

Post by Turley »

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
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: compiling under windows

Post by RusseL »

Code: Select all

C:/polsvn/trunk/lib/STLport5/build/lib/nmake clean install

../Makefiles/nmake/sys.mak(28) : fatal error U1052: not found "../Makefiles/nmake/vc10.mak"
Stop.
any ideas? >_<


solved:
simply rename vs9 to vc10
Windows7 & vcexpress10
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: compiling under windows

Post by Turley »

damn ignore patterns... fixed
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: compiling under windows

Post by Yukiko »

Thanks OWHorus and Turley!!!

I am definitely NOT a C (add variety symbol (++ # or whatever)) programmer so I have no experience compiling C code. It's a confusing mess for me since I came from the good ole Pascal days. So this tutorial was a god-send. One thing that should be added to this is the build for STLPort5 takes a while so for those who might think you are caught in an infinite loop while that's happening, you're not. It looked that way to me because I kept seeing what appeared to be the same thing scrolling by in the command prompt window. I know you experienced C programmers know this but I offer it for the old dogs like me.

YAY!! The build just finished successfully.

Thanks.
Duttones
Apprentice Poster
Posts: 54
Joined: Tue Mar 27, 2012 8:56 pm

Re: compiling under windows

Post by Duttones »

When i try to compile, i get this error:

Unable to start program
'C:\Users\Vitor\Documents\POLfromSVN\pol-core\bscript\.\Release\bscript.lib'

The specified file is an unrecognized or unsupported binary format.

Anyone know how to fix?
Voicer
Neophyte Poster
Posts: 30
Joined: Fri Oct 06, 2006 8:30 am
Location: Poland

Re: compiling under windows

Post by Voicer »

when building latest rev, in VS 2008, there is an error in clib-2008.vcproj file

Code: Select all

</File>
</File>
<File
RelativePath=".\dualbuf.h"

should be:

Code: Select all

</File>
<File
RelativePath=".\dualbuf.h"
(remove one unnecessary </File> )
Post Reply