Complete error message:
Error 1 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'const std::_List_iterator<_Mylist>' (or there is no acceptable conversion) c:\ebooks\sourcecode\programing_game_ai_by_example\buckland_sourcecode\vs8 projects\buckland_chapter3-steering behaviors\path.h 54 1 Steering
I am very new to [V]C++ world. I was reading Programing Game AI by Example book and trying to study/analyze the source code which is available in publishers site.
It seems like entire source code is written in VS8 but I am using VS12 Express edition. The project conversion seems have no problems expect 4 warnings which I am getting for all the projects (see below).
But the problem is I am getting a compile error which seems to me, with basic knowledge I have is with operator overloading of a strongly typed list, but I am not sure if its true and I have no clue how to fix it if its true.
Code line for error#1:
Vector2D CurrentWaypoint()const{assert(curWaypoint != NULL); return *curWaypoint;}
Declaration of the problem variable:
std::list<Vector2D>::iterator curWaypoint;
Extended code snippet including constructors:
//constructor for creating a path with initial random waypoints. MinX/Y
//& MaxX/Y define the bounding box of the path.
Path(int NumWaypoints,
double MinX,
double MinY,
double MaxX,
double MaxY,
bool looped):m_bLooped(looped)
{
CreateRandomPath(NumWaypoints, MinX, MinY, MaxX, MaxY);
curWaypoint = m_WayPoints.begin();
}
//returns the current waypoint
Vector2D CurrentWaypoint()const{assert(curWaypoint != NULL); return *curWaypoint;}
//returns true if the end of the list has been reached
bool Finished(){return !(curWaypoint != m_WayPoints.end());}
Now I am not sure where to go to after this, but the list and iterator definitions are inside the WindowsUtils.h file.
I am not pasting remaining errors which are same, however you can access the entire Path.h file here
Can someone tell me how to fix this? I am always scared of c++, particularly with vc++, but I can fix it by myself if some one guides me what the issue is and approach to fix it
Errors
Error 1 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'const std::_List_iterator<_Mylist>' (or there is no acceptable conversion) c:\ebooks\sourcecode\programing_game_ai_by_example\buckland_sourcecode\vs8 projects\buckland_chapter3-steering behaviors\path.h 54 1 Steering
Error 2 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'const std::_List_iterator<_Mylist>' (or there is no acceptable conversion) c:\ebooks\sourcecode\programing_game_ai_by_example\buckland_sourcecode\vs8 projects\buckland_chapter3-steering behaviors\path.h 54 1 Steering
Error 3 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'const std::_List_iterator<_Mylist>' (or there is no acceptable conversion) c:\ebooks\sourcecode\programing_game_ai_by_example\buckland_sourcecode\vs8 projects\buckland_chapter3-steering behaviors\path.h 54 1 Steering
Error 4 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'const std::_List_iterator<_Mylist>' (or there is no acceptable conversion) c:\ebooks\sourcecode\programing_game_ai_by_example\buckland_sourcecode\vs8 projects\buckland_chapter3-steering behaviors\path.h 54 1 Steering
5 IntelliSense: no operator "!=" matches these operands
operand types are: const std::_List_iterator<std::_List_val<std::_List_simple_types<Vector2D>>> != int c:\eBooks\SourceCode\programing_game_ai_by_example\Buckland_SourceCode\VS8 projects\Buckland_Chapter3-Steering Behaviors\Path.h 54 38 Steering
Just in case if this matters, below is the warnings I keep get for every project in the book's source code
*Common solution conversion warnings: * (note: not the same project as above)
Conversion Report - WestWorld1.vcproj:
Converting project file 'C:\eBooks\SourceCode\programing_game_ai_by_example\Buckland_SourceCode\VS8 projects\Buckland_Chapter2-State Machines\WestWorld1\WestWorld1.vcproj'.
Web deployment to the local IIS server is no longer supported. The Web Deployment build tool has been removed from your project settings.
Done converting to new project file 'C:\eBooks\SourceCode\programing_game_ai_by_example\Buckland_SourceCode\VS8 projects\Buckland_Chapter2-State Machines\WestWorld1\WestWorld1.vcxproj'.
This application has been updated to include settings related to the User Account Control (UAC) feature of Windows Vista. By default, when run on Windows Vista with UAC enabled, this application is marked to run with the same privileges as the process that launched it. This marking also disables the application from running with virtualization. You can change UAC related settings from the Property Pages of the project.
VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.
MSB8012: $(TargetPath) ('C:\eBooks\SourceCode\programing_game_ai_by_example\Buckland_SourceCode\VS8 projects\Buckland_Chapter2-State Machines\WestWorld1\.\Debug\WestWorld1.exe') does not match the Linker's OutputFile property value '.\Debug/WestWorld1.exe' ('C:\eBooks\SourceCode\programing_game_ai_by_example\Buckland_SourceCode\VS8 projects\Buckland_Chapter2-State Machines\WestWorld1\Debug/WestWorld1.exe') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).
MSB8012: $(TargetPath) ('C:\eBooks\SourceCode\programing_game_ai_by_example\Buckland_SourceCode\VS8 projects\Buckland_Chapter2-State Machines\WestWorld1\.\Release\WestWorld1.exe') does not match the Linker's OutputFile property value '.\Release/WestWorld1.exe' ('C:\eBooks\SourceCode\programing_game_ai_by_example\Buckland_SourceCode\VS8 projects\Buckland_Chapter2-State Machines\WestWorld1\Release/WestWorld1.exe') in project configuration 'Release|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).