Building GCC4 with VS2010 Express

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

    • RE: Building GCC4 with VS2010 Express

      GCC 4 was built using Visual Studio 2010 so you should be fine. I think express edition will work just as well.

      -Rez
    • Rez,

      Well, it built with VS2010 Express, as you said. But not without some difficulty and a bit of head scratching.

      The problem was that AfxRes.h is referenced as an include file, but AfxRes.h (which is really part of MFC) is not supplied with the Express edition of VS 2010.

      Looking at AfxRes.h, it seemed it was only being used to include Windows.h, since GCC doesn't need the MFC definitions. So I changed the include of AfxRes.h to include Windows.h instead. Then I specified my VS2005 directory which contained Windows.h (and related .h files) as an additional include directory path.

      That caused a bunch of build errors (duplicate definitions and declarations.) So I got rid of that path. I then set up a new directory with only Windows.h in it. Just as I fired off the build, I realized that I forgot to add the new directory as an additional include path. Oh, well.

      The amazing thing is that it built -- with NO errors. I'm wondering where it did include Windows.h from? Not to mention that Windows.h includes a bunch of other files that weren't present. Can it be that you've got them supplied with the GCC4 code in a precompiled header file?

      (Just for the record -- I had removed the Editor from the build, for simplicity. I'll try building that later on.)

      Next step -- Let's see how it runs.
    • No, we didn't add any of that stuff. I think express comes with Windows.h and the dependencies. I would be very surprised if it didn't.

      Glad you got it working. :)

      -Rez
    • Really. Well, I can't find Windows.h anywhere -- but that's a mystery I will have to look into on another day.

      Trying to run it was a bit more "fun" than building it. I'll note the problems and solutions here -- both to possibly save others some grief, and also because there's an item or two that I think should be addressed on your end.

      That was a great suggestion in the ReadMe to try to build and run a DirectX SDK example. It built fine, but I got an Illegal Instruction when it ran. (The supplied executable ran fine. I also found I can't do DX11.)

      The C++ Code Generation project property Enable Enhanced Instruction Set had to be changed to "Not Set". This had to be done in more than one project (for both the SDK and the Game). That fixed the Illegal Instruction crashes.

      Changed per the ReadMe -- In Game\PlayerOptions.xml, renderer="Direct3D 11" to renderer="Direct3D 9". However there is a code change required for 3D9 too. (There's a comment in the code, that I stumbled across. But the ReadMe should mention the code change too.) What I had to do was uncomment the line for 3D9 and comment out the one for 3D11. (That comment I found could be a little clearer about having not only to uncomment but also comment out a line of code.)

      Next problem, crashing with an Illegal Address/Access Violation due to a null pointer (g_pApp->m_Renderer) in OnD3D9DestroyDevice.

      Found the fix Rez made to check for null pointer in the OnD3D11DestroyDevice routine, but it apparently never made it into the corresponding OnD3D9DestroyDevice routine. Added it. (Should be fixed in the code base.)

      That finally got me to the blue Main Menu screen. But clicking Start did nothing. Hmm.

      (BTW, I have to confess that I've been "flying blind". I don't have the 4th Ed book yet, just the 3rd Ed. But the ReadMe was a great help, listing the steps that needed to be done to be able to build sucessfully.)

      Found another comment/note in the Main Meseenu screen code re if Start is clicked without a valid selection, then should either put up a dialog box or else default a selection. Good idea, but right now it does nothing. Made a selection, clicked Start and the game finally started!

      I see a number of differences from TeapotWars 2005. I'll have to check out the game operation some more -- but I'm now up and running TeapotWars 2010!, built on VS2010 Express!
    • This post describes the exact problem I met and gently offers proper solution. I owe you a beer, RanZim!

      Thanks,
      kc
      Originally posted by RanZim
      Really. Well, I can't find Windows.h anywhere -- but that's a mystery I will have to look into on another day.

      Trying to run it was a bit more "fun" than building it. I'll note the problems and solutions here -- both to possibly save others some grief, and also because there's an item or two that I think should be addressed on your end.

      That was a great suggestion in the ReadMe to try to build and run a DirectX SDK example. It built fine, but I got an Illegal Instruction when it ran. (The supplied executable ran fine. I also found I can't do DX11.)

      The C++ Code Generation project property Enable Enhanced Instruction Set had to be changed to "Not Set". This had to be done in more than one project (for both the SDK and the Game). That fixed the Illegal Instruction crashes.

      Changed per the ReadMe -- In Game\PlayerOptions.xml, renderer="Direct3D 11" to renderer="Direct3D 9". However there is a code change required for 3D9 too. (There's a comment in the code, that I stumbled across. But the ReadMe should mention the code change too.) What I had to do was uncomment the line for 3D9 and comment out the one for 3D11. (That comment I found could be a little clearer about having not only to uncomment but also comment out a line of code.)

      Next problem, crashing with an Illegal Address/Access Violation due to a null pointer (g_pApp->m_Renderer) in OnD3D9DestroyDevice.

      Found the fix Rez made to check for null pointer in the OnD3D11DestroyDevice routine, but it apparently never made it into the corresponding OnD3D9DestroyDevice routine. Added it. (Should be fixed in the code base.)

      That finally got me to the blue Main Menu screen. But clicking Start did nothing. Hmm.

      (BTW, I have to confess that I've been "flying blind". I don't have the 4th Ed book yet, just the 3rd Ed. But the ReadMe was a great help, listing the steps that needed to be done to be able to build sucessfully.)

      Found another comment/note in the Main Meseenu screen code re if Start is clicked without a valid selection, then should either put up a dialog box or else default a selection. Good idea, but right now it does nothing. Made a selection, clicked Start and the game finally started!

      I see a number of differences from TeapotWars 2005. I'll have to check out the game operation some more -- but I'm now up and running TeapotWars 2010!, built on VS2010 Express!