How Shall I Compile and Run the Source Code of GCC4?

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • How Shall I Compile and Run the Source Code of GCC4?

      The source code accompanying this book is divided into two parts: the engine (GameCode4) and the game that uses this engine (Teapot Wars), as mentioned in the section "CREATING A PROJECT" of Chapter 4. However, after downloading these source code parts, I found it difficult to compile and run the game. I scanned the first few chapters, but besides the few pages describing how to configure the VS project settings, I found little about the source code itself. How I wish the source code included a solution file!

      So, must I read the entire book through before I can actually find a way to "play" the game? That's a little discouraging. If the book had been written in the way that the first chapters built a really small game, and expanded it (both in the structure and the content) in later chapters, we would feel more comfortable about the learning process.

      Nevertheless, the authors must have good reasons to write this book in this way. So, one final question: does the "Teapot Wars" turn out to be an interesting game? :D Does it contain every single important aspect mentioned in this thick book? Is it really easily expandable? I want to know. Thank you!
    • The Teapot Wars game does have a solution file, https://code.google.com/p/gamecode4/source/browse/#svn%2Ftrunk%2FSource%2FTeapotWars%2FMsvc

      As far as the teapot wars game itself, it is a simple example of everything described in the book, it is easily expanded through the actor system.
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • mholley519 wrote:

      The Teapot Wars game does have a solution file, code.google.com/p/gamecode4/so…ource%2FTeapotWars%2FMsvc

      As far as the teapot wars game itself, it is a simple example of everything described in the book, it is easily expanded through the actor system.



      Thank you, sir! So, what I have to do is open that solution file with Visual Studio 2010, and build and execute it just like a normal Win32 Console Program? But there have been several error messages duiring the build, complaining its inability to include the DirectX header files. I went to the property pages, and clicked the Configuration Properties->VC++ Directories item, and I found that the last item in the "Include Directories" field was "$(DXSDK_DIR)\Include$". So do I have to replace this item with the actual DirectX include folder, or is there any more elegant way, such as defining the DXSDK_DIR somewhere else, to get it around?

      Thank you!
    • I'm not a DirectX user so I don't know specifically, but if I remember correct the DXSDK_DIR should be defined when you install the SDK, if not than I'm sure you could make a new environment variable for this that points to the proper folder.
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • Hi SuperSaiyan3!

      Take a look at the README.txt file at the root of the source code directories. There are a number of steps you must carefully take to get the game compiled and running. Sorry for the complexity - but Rez and I did try very hard to include everything in the book, so there are many moving parts.

      If it is giving you trouble, please feel welcome to post your compile or linker errors on the forum and I'm sure that this community can help you.

      As far as whether Teapot Wars is a fun game, in this author's humble opinion I'd say, well, no. :)

      It wasn't designed really to be fun, but rather a prototype game that uses every line of source code from the book, so that new game programmers can start with something a little more interesting than a colored rotating cube.
      Mr.Mike
      Author, Programmer, Brewer, Patriot