TGEA/CreatingYourFirstFPS/Compile
From TDN
Navigation
FPS Tutorial
RPG Tutorial
Version Control
Be sure to read the section on Directory structures for Version Control
First Compile
What we want to accomplish is to have the games directory and the engine directory at the same level in the directory structure.
C:\dev\TGEA_1_7_1\engine
C:\dev\TGEA_1_7_1\games
We also checked in the stronghold directory into svn. We then check out the stronghold example game to C:\dev\TGEA_1_7_1\games\<game name for stronghold> You should rename the stronghold directory to the name of your game. My game name is chart coaster. So C:\dev\TGEA_1_7_1\games\ChartCoaster is where I checked out the contents of the stonghold demo.
Open your game directory and navigate to the buildFiles directory. Here you will see all the setups for the free versions of the MSVC compilers. In this example we are using Visual Studio 2008. Open the VisualStudio 2008 folder and double click the Stronghold.sln.

This will bring up the msvc project window as seen below.

Select stronghold under the solution explorer (this is your game, the rest are instructions on compiling the various tools used in the TGE) Then go to the build menu and select "Build Stronghold" this will begin the process of compiling your new game to an executable. With any luck you will see the following error message(s)
9>..\..\..\..\..\engine\source\platformWin32\getdxver.cpp(20) : fatal error C1083: Cannot open include file: 'dxdiag.h': No such file or directory
9>c:\ampedlabs\TGEA_1_7_1\engine\source\gfx/D3D9/gfxD3D9Device.h(11) : fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory
9>gfxD3D9EnumTranslate.pc.cpp
9>c:\ampedlabs\TGEA_1_7_1\engine\source\gfx/D3D9/platformD3D.h(10) : fatal error C1083: Cannot open include file: 'd3dx9tex.h': No such file or directory
9>c:\ampedlabs\TGEA_1_7_1\engine\source\gfx/D3D/DXDiagNVUtil.h(72) : fatal error C1083: Cannot open include file: 'dxdiag.h': No such file or directory
And more...
These errors are telling you to install the latest directX sdk (you have to install directX <again> after you install MSVC 2008) So get the latest directX SDK and install it. If you are having trouble just finding it just google "DirectX SDK" and it will point you to the right place. NOTE: Do not use the November 2008 DirectX SDK as there is a bug with this version Details here: http://www.garagegames.com/mg/forums/result.thread.php?qt=80763
Remember, after you install directX (again), you will need to close MSVC. Next re-open the stronghold.sln. This time, through the "magic of microsoft," the MSVC 2008 compiler will know where to find the directX include files. Everything will compile nicely. I'll not cover how to distribute your game with directX as its beyond the scope of this tutorial.
Second Compile
After you grabbed the latest directX sdk and installed it, you probably succeeded. Now the question is where the heck did it put the executable? The answer is it put it in your game directory:
C:\dev\TGEA_1_7_1\games\<my game>\game
or in my case
C:\dev\TGEA_1_7_1\games\ChartCoaster\game
Well, it compiled the game executable with the name stronghold.exe. And its 4 times larger than the original stronghold.exe that I renamed to ChartCoaster.exe. What gives? You may want to switch the build a debug version or a release version druing your development cycle. To do this select project / properties and select (release) from the drop list at the top of the properties popup window as seen below:
Take the time to explore the project properties window. You'll find lots of things you'd like to work with in the future right here. You can change the name of the executable (from stronghold.exe) to the name of your game by changing the output file name in the linker section.






