Trouble compiling code from book

So i bought this book, "Programming Game AI by Example". Read about the first 2-3 chapters then finally had a chance to sit down and play with the source code. They examples are meant for Visual C++ 6.0 or 8.0, I have Visual C++ 2008 Express edition but I've never really used it for anything because it seems so confusing, I've been happy just using Dev-C++.

So anyway, I can't get it to compile even though I've done everything he said to do.

I get 4 errors, they all look pretty much the same, like this. 

 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'const std::list<_Ty>::_Iterator<_Secure_validation>' (or there is no acceptable conversion)

This problem I "fixed" by commenting out an assert() for the time being. I'm just trying to get the damn thing to work now.

Now I have another problem: fatal error RC1015: cannot open include file 'afxres.h'.

What that is, I don't know. It's in Script1.rc which is labeled with //Microsoft Developer Studio generated resource script.

You can download the source code for yourself if you wish at

In the back of the book he says to do this in order to compile the code.
1. Download the zip file with the source code (up there ^) (for example C:\AI Source)
2. Download and install the Boost library headers. (which i did) (for example C:\boost_1_31_0.)
3. Add the following paths to the general settings of your compiler in your development enviroment.

Include file paths
- C:\boost_1_31_0
- C:\AI Source\Common
- C:\AI Source|Common|lua-5.0\include
- C:\AI Source\Common\luabind

Source file paths
- C:\AI Source\Common
- C:\AI Source\Common\lua-5.0
- C:\AI Source\Common\luabind

Library file paths
- C:\AI Source\Common\lua-5.0\lib

I'm not proficient at all with Visual Studio, so I'm sorry if whatever the problem is, is trivial. Thanks for your help.

Last edited on
Well honestly this stuff is much out of my knowledge range, but just looking at the error it seems like all that's going on is that the comparison between the two types, specifically the left hand side of the "!=", isn't possible (which I assume is being used in some conditional or loop?). Such as how you cannot do "if (int != string)." Post the lines on which the errors take place.
Okay, i posted on as well and someone said that using the boost library, you shouldn't be comparing to NULL. Instead I changed it to TheVector.end()(sorry I forgot to include the line, it was something like this, I don't have it open)

Vector2d Somefuction(){
      assert(aVectorIterator != NULL); //here
      return *aVectorIterator;

and the second error I 'fixed' by searching my computer for afxres.h

There was a file by that name in Dev-C++'s include folder so I copy and pasted it into Visual C++'s include folder and it worked.

Then after that it compiled and ran but at 2 fps, then I fixed that by doing a release build instead of a debug build.

Now I'm just having trouble
Last edited on
Topic archived. No new replies allowed.