A ton of errors :(

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

    • A ton of errors :(

      Today I was trying to build Teapot Wars and I ran into more than 100 errors for 3 of the 4 projects :(. Strangely, most of the errors are caused by the using std::tr1::X type command in GameCodeStd.h but according to what I found on the Internet, std::tr1::shared_ptr and such are in <memory.h> which is obviously included. But one time (I'm a total noob about Visual Studio so I don't know how I managed to get a different build output whitout changing a single line of code), I got only 3 errors that were caused by an #error command in a std lib file (I don't remember the name). So if somebody has an idea about how I can fix this (I followed the instructions in GCC4\README.txt), his help would be very appreciated !

      PS : Sorry for the bad english, I'm French :)
    • TR1 is now in the C++11 standard, and as such can simply be accessed by std::X rather than std::tr1::X, however I would imagine it would be backwards compatible.
      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
    • Ok first off, what compiler set are you using and what version?

      Shared pointer is included in <memory>, but first off lets figure out your compiler situation.
      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
    • Ok, so this is something I may have overlooked, what errors are you getting? I assumed that it was an error regarging std::tr1::shared_ptr not being found, what is the actual error though? Posting an error log would help.
      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
    • Sorry but I didn't manage yet to configure this stupid Visual Studio to be in english, and I won't be at home during four days so I post on pastebin the french (If you can understand a bit what's going on, I translated the first 100 errors but they're more or less the same) error log. I will post it in english when I will find time to download the english version of VS Express 2013.
      As I said, all the errors seem to come from the fact that shared_ptr and such is not recognized by the compiler.
      So here is the error log : Error log
      A lot of thanks for your help !
    • It is not finding shared_ptr or weak_ptr for one, are you including the 'memory' header before they are used? Also you are using Visual Studio 2013 which is still a preview, maybe there is a bug with the compiler they are working out?
      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
    • I work on VC++ 2013 Express. After quickly dealing with shared_ptr problem (just add <memory> header and delete "tr1::") I got another one:

      Source Code

      1. C2719: 'CompareFunc': formal parameter with __declspec(align('16')) won't be aligned y:\CPP\GameCode4\Source\GCC4\3rdParty\bullet-2.79\src\LinearMath\btAlignedObjectArray.h 304


      Anyway I get the impression that provided source code is not provided in the way is meant in the book. There is a section about building where is said that a project must be automatized at most as possible and easy to change for new needs. I don't think that using this

      Source Code

      1. devenv bullet-2.79\msvc\vs2010\0BulletSolution.sln /build Debug /project BulletCollision /projectconfig "Debug|Win32"
      2. devenv bullet-2.79\msvc\vs2010\0BulletSolution.sln /build Debug /project BulletDynamics /projectconfig "Debug|Win32"

      is a good way of building a project (at least there must be used msbuild). Also for x64 most of projects build sucessfully on my system (W7 Pro x64), apart from Lua project that is a trickier.
      I saw here a lot of negative view of Visual Studio 2013 as "probablly being too buggy" and is really funny to read that. First it has a greater coverage of C++11, second it has an improved Intellisense and sort of refactoring (which is important for express version), third is more stable than 2012 and a lot more stable and extended than 2010 and fourth it is RTM now. Many libraries that I use like boost, SFML and others support VS2013 from the preview and a lot of them are updated to C++11, here I see a pretty conservative crowd.

      The post was edited 1 time, last by MojaveWastelander ().

    • In development environments most studios wait until a new product is well seasoned before they upgrade, for instance I did not find Visual Studio 2012 to be stable until months after its actual release. Also due to the cost of Visual Studio, a yearly upgrade would be expensive. As far as I know Mike and Rez use Visual Studio 2010 still. 2012 had some build issues to be worked out, I am sure 2013 is the same.
      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
    • "I am sure 2013 is the same" - that is exactly what I am talking about, you didn't even try it to make a difference. Here you can see some Visual C++ 2013 improvements and you can find about more improvements and discussions in Visual C++ blog. Another important fact is the outdated compiler and linker, every next version improve the quality of output binaries by some degree, not saying the push on new standard and if you'll look here you'll see that ISO C++ is finally taking some speed in adoption of new features. But we get a new book about game development with C++ that doesn't really encourage to use new standard.
      "What is the auto keyword doing in that function? Theres a new standard being published called C++0x, or C++ 11. This new standard adds a huge amount of really cool features to the C++ language, some of which were covered in Chapter 3. If you have Visual Studio 2010, you can take advantage of a few of them."

      Although this book is good, it is kind of sitting in the past and is pretty hard to read this book source and some new "Effective C++" or this one forcing new ideology in C++ programming. There are already two times that "Going native" was organized by MS, but we are still talking about C++0x and a cool "new" feature auto in a new book.
      Another point is the fact that if VC++ compiler is not fully supporting C++11, gcc is far ahead, so in *nix environments new standard is on table and they don't seems to fear about that.
      Take a look at new SFML book on game programming. There you can really see what means showing some new cool features of the language (which in fact are already old, if one was in this "C++ renaissance" movement from the start).
      Also many readers are new to game dev or indie, for them is pretty much enough to use Express version of the Visual Studio and is more appropriate to use it as a reference, not the paid versions, because if you get used to Express version the paid one will be just more productive and extensible, so your point of new versions being too expensive seems to be just an excuse.
      I would suggest authors apart from a good coverage of game development to keep up with the new additions to the standard and use up-to-date tools, because most users will use them.

      As a last note these days I have rebuild MongoDB from source code. You should give it a try to get the feeling of a easy build process, (although it takes some time to make those scons files for library developers, users will be very thankful), you get a great build tool where from command line you can build almost whatever you want and how you want (here I mostly point out on libraries building in GCC). Another try can be made with boost, which also is pretty good and easy use and this is how I see an easy build process.

      The post was edited 1 time, last by MojaveWastelander ().

    • I did not try it because upgrading my large suite of software in the middle of multiple projects is generally a bad idea, when I upgraded a game I was working on from VS2010 to VS2012, I had a hiccup in my development as I had to now spend time working with new settings, and changes in the compiler. Saying I did not even try to download VS2013, upgrade my version, and hope that the process of reverting back to 2012 so that my own projects do not require downtime, is completely correct, I'm not saying 2013 isn't an improvement, what I am saying is that Microsoft products are known to have initial release issues that may go well into their post-production phase before they are fixed. As for the book not using C++11 to the fullest, the book was published months before VS2012 was released, let alone the fact that they were writing the new book long before that.

      The authors not keeping up with the standards is actually most indicative of the game industry, most won't upgrade unless they are really convinced that the upgrade is worth the trouble, it's easy enough to upgrade one station to new software but not an entire workplace, I imagine any job I find in the industry will be using VS2010 at the most, if not 2008 or even 2005.

      I would say there is no build system in place as the book attempts to familiarize the user with the Visual Studio setup environment, sure CMake, Jam, or Scons are simple enough for someone experienced with development, but the idea of the book is to get people with a decent amount of C++, but not necessarily heavy experience to easily get started in engine development.
      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
    • When we wrote the book, C++ 11 was just becoming the new standard. There are a number of features in C++ 11 that are great and compilers are quickly coming up to speed on those features. But they're not there yet. Mike and I talked about whether or not we wanted to include any of the C++ 11 stuff in the book and ultimately decided that we'd allow a few things here and there, but we wouldn't go crazy and would call out things as they came up. In the end, this book is about game architecture, not about the C++ language. There are plenty of really great books (several of which you mentioned) that talk about how to most effectively use C++ 11. On the flip side, you can apply the GCC architecture to any number of languages (and several of our readers have).

      At Maxis, we're still using Visual Studio 2010 and, up until very recently, were using 2008 for a number of tools. Even with the C++ 11 features available in VS 2010, the official coding standard for our project only allows us to use the auto keyword, and only for STL iterators. We aren't allowed to use any other features. Why? Because we have to build the game using many different compilers across many different platforms. The Sims 4 is only for Windows right now, but we might end up doing a Mac build, an xbox build, a playstation build, a Wii build, and who knows what else. Many of these compilers aren't using C++ 11 quite yet.

      Regarding your comments about our hesitancy to use Visual Studio 2013, you can blame history for that. Unless required, I refuse to use a new version of VS until at least service pack 1 is out. Every time I've broken that rule, I've been sorry (I'm not exaggerating, literally every time). When upgrading to Visual Studio 2010, we were plagued by ridiculous bugs. My personal favorite was how the Find menu would constantly grow whenever you used it. Who writes that bug? Were they even using their own software? It was also pretty unstable. I'm sure it was mostly fine with small projects that were only 10,000 lines or so, but we were compiling solutions with dozens of project files and thousands of source files across three languages. The Sims Medieval had over 1.5 million lines of code (I think it was around 2.5 million, actually). Early versions of VS 2010 had a lot of trouble handling that. The only reason we upgraded was because the final executable ended up being fast enough that it was an instant four or five FPS gain. That was worth it.

      I'm all for trying out new versions of Visual Studio and if you want to build your game with VS 2013 and use as many C++ 11 features as possible, I think that's great. I would do the same thing for some random experimentation projects of mine. But, I would never build a real game that way, at least not until it gets a bit more traction.

      As for keeping up to date with new editions, we used the latest version of everything that was available when the book came out. It's nearly impossible to keep it 100% up to date because every new release of every product will completely break something somewhere. If we were to do a 5th edition, it would use whatever was industry standard at the time.

      -Rez
    • Thank you for your advices Rez !
      So I removed my 2013 version and installed VC++ 2010 Express. And then I realized that I couldn't open the Teapot Wars Editor (which is written in C#) and neither can I install VC# because only one can exist at a time. So I'm quite fed up with trying to build Teapot Wars (I managed to get only two errors : a small file, afxres.h, wasn't founded by the compiler but when I included it, some linkers errors happened). Anyway, I will follow the source book and the code to build a smaller 2D graphics engine (I find unfortunate that the 2D Graphics part was removed from the 4th edition because it could have helped me a lot !). Thanks for your help again everyone !

      The post was edited 2 times, last by Kegnarok ().

    • Hello everyone,

      First let me thank Mr Mike and Mr Rez for writing this book and sharing their knowledge. I've been a fan of the Game Coding Complete series since the 2nd edition. I'm learning a lot by reading these books.

      I had the same error as Kegnarok when I tried to build GCC4 with VC++ Express 2012.

      The problem is that Express editions do not support resource file editing, try editing the .rc and you will get the error "Resource Editing in not supported on the Visual C++ Express SKU".

      See this forum

      That's why we get resource errors such as "afxres.h file not found". Then I used Visual Studio 2010 Ultimate edition. Compiling went fine, but I had a Direct3D error. After rebuilding the 3rd party libraries, the error was still there. After debugging, I found out that the default screen dimension in the Options struct were not OK with my graphics card (don't know why), I modified it from 1024x768 to 1024x720.

      Now it all works fine, I can compile and run the TeapotWars demo!

      New question : at the end of the checkout using Tortoise SVN, I had this error saying "UtiliyDemo.exe not found". Then I tried to cleanup my repository and check out once again, but I still get the same error.
      Any clues ?

      Thank you guys.
      Files
      French guy looking for a job in the Game industry in Canada

      My Linkedin profile