I've decided to revive the build process for Vegastrike using Code: Blocks and the Visual C++ Toolkit 2003, partly because the Visual Studio Express gives me a lot of grief, and partly because my only successful attempts to compile VS apart from C:B were with the Visual C++ .Net 2003 IDE, which contains the same tools as the (once freely made available) Toolkit 2003.
Please see the first part of the Code::Blocks saga in http://vegastrike.sourceforge.net/forum ... =5&t=13290
A lot of what I will put here is just a reiteration of what's in the older thread.
I have decided to take a "clean room" approach, to eliminate any possible rogue code/headers/tools left over on the machine from previous attempts. Therefore, I set up a virtual Windows 2000 machine in VMWare, and built everything from the ground up. It is perfectly reproducible.
Sources:
A. Tools
1. Code::Blocks, version 8.02. Download from the website the version without bundled mingw. Direct link: http://downloads.sourceforge.net/codebl ... -setup.exe
2. Visual C++ Toolkit 2003. Once freely available from Microsoft, now difficult to find. Do a Google search for "VCToolkitSetup.exe" Here is one of the available links: http://npsg.dl.ac.uk/MIDAS/MIDAS_Releas ... tSetup.exe Also ftp://ftp.qut.edu.au/pub/microsoft/vcto ... tSetup.exe and ftp://ftp.ur.ru/Updates/Microsoft/Visua ... tSetup.exe
3. Microsoft Platform SDK for Windows XP SP2. Here is a stripped down version that contains all you need to compile Vegastrike: http://www.megaupload.com/?d=KXZDDYGK
4. DirectX9 SDK, similarly stripped down (yes, you need parts of the SDK despite Vegastrike using OpenGL). http://www.megaupload.com/?d=AB9TR3LV
5. Resource compiler, not included in the toolkit. Here are the files from VC++ .NET 2003: http://www.megaupload.com/?d=4GY9JDV9
6. A few libraries from the .NET SDK 1.1: http://www.megaupload.com/?d=TKSLJIFU
B. Code. All you really need are vegastrike, vega-vc7 and win32 from the SVN, as well as a patch I made originally to get VS to compile in VC++2003. The patch is against revision 12720 of the SVN source code. You can find it here: http://www.megaupload.com/?d=JY8UUUPY
C. Procedure.
On a clean machine, no tools or code installed, the following should lead to a viable build environment.
1. Install the VC++ toolkit 2003 to its default location (C:\Program Files\Microsoft Visual C++ Toolkit 2003)
2. Install the PSDK - I generally put it in c:\PSDK
3. Install the DirectX SDK. I put it in c:\DXSDK
4. Install Code::Blocks to its default location. It should detect that you have the Toolkit 2003 installed. Set the toolkit as default build environment.
5. Download from SVN the vegastrike, vega-vc7 and win32 targets. I put them in c:\VS\vegastrike (vega-vc7, win32).
6. Download my patch from the link above (http://www.megaupload.com/?d=JY8UUUPY). Unzip it in the main directory where you put the SVN code (C:\VS). Allow it to overwrite files. NOTE as of revision 12725 the patch has been integrated in the main trunk so you can skip this step.
7. Configure C::B. Open it, then go to Settings > Compiler and debugger > Search directories. Under the compiler tab, add the include directories from the PSDK (c:\PSDK\Include) and Directx SDK (C:\DXSDK\Include). Under the Linker tab, similarly add the Lib directories from the PSDK and DXSDK. Under the Resource compiler tab add the include directory of the toolkit itself (C:\Program Files\Microsoft Visual C++ Toolkit 2003\include) as well as the include directories from the PSDK and the DXSDK. Close Code::Blocks. Open it again and check the search directories again to make sure it remembers what you entered (sometimes it doesn't).
8. Unzip the extra libraries from A6 above to C:\Program Files\Microsoft Visual C++ Toolkit 2003\libs
9. In Code::Blocks go to File > Import project > MS Visual studio solution, and choose vega-vc7/vegastrike.sln Answer yes to all.
10. Make adjustments to the project so it compiles cleanly. Right-click on "vegastrike" in the left panel, select "build options" and in "compiler settings>other options" change the /W to /W2. In the same extra options panel add /EHsc to the option list. Open vegastrike/Resources.rc and change #include "afxres.h" to #include <WinResrc.h> ; save all.
(edited for r12742) Also in build options>compiler settings, click on tab "#defines" and add at the end of the list NV_CUBE_MAP so the resulting binary compiles with the new cubemap backgrounds support. Also create a new file in vegastrike/src, naned "config.h" and add the following in it:
Code: Select all
#pragma warning(disable: 4786)
That's it. Now right-click on vegastrike again, and select "build". After a while you should have a "vegastrikeRVC7.exe" in win32/bin
Comments welcome.