These are the errors I get with a fresh copy of Build errors_ver 2.2_VisualC++2005Express

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

    • Build errors_ver 2.2_VisualC++2005Express

      These are the errors I get with a fresh copy of

      2.2 following all instruction in the readMe

      file using Visual C++ 2005 Express Edition.


      6 errors were given: error 1,3,4,5,and 6 were
      duplicates:

      Error 6 fatal error C1083: Cannot open
      include file: 'atltypes.h': No such file or
      directory c:\projects\gamecode
      v2.2\source\gamecodestd.h 58

      Error 2 was the only other error:

      Error 2 fatal error RC1015: cannot open
      include file 'afxres.h'. c:\projects\GameCode
      v2.2\Source\Lang\Strings.rc 10

      What is the best fix for the atl/mfc issue for
      VS 2005 Express (besides spending a bunch of money)?

      Everytime I try to implement a solution, I only succeed in getting more errors...so I've restarted the process so that I can get some advice about the proper solution for getting the game to build.
      n00b

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

    • Honestly? The best fix is write your own version of atltypes.h. Specifically, you'll need to write CSize, CPoint, and CRect. Somewhere around here I posted my versions of Rect and Point (I didn't rewrite CSize since I don't use it). Here they are again (I made a couple tweaks since the last post):

      Brainfuck Source Code

      1. //------------------------------------------------------------------------------------------
      2. // This class represents a single point in 2D space
      3. //------------------------------------------------------------------------------------------
      4. class Point : public tagPOINT
      5. {
      6. public:
      7. //long x, y;
      8. //construction
      9. Point(void) {x = y = 0;}
      10. Point(long newX, long newY) {x = newX, y = newY;}
      11. Point(const Point &newPoint) {x = newPoint.x; y = newPoint.y;}
      12. Point(const Point *newPoint) {x = newPoint->x; y = newPoint->y;}
      13. //assignment
      14. Point& operator=(const Point &newPoint) {x = newPoint.x; y = newPoint.y; return (*this);}
      15. Point& operator=(const Point *newPoint) {x = newPoint->x; y = newPoint->y; return (*this);}
      16. // addition/subtraction
      17. Point& operator+=(const Point &newPoint) {x += newPoint.x; y += newPoint.y; return (*this);}
      18. Point& operator-=(const Point &newPoint) {x -= newPoint.x; y -= newPoint.y; return (*this);}
      19. Point& operator+=(const Point *newPoint) {x += newPoint->x; y += newPoint->y; return (*this);}
      20. Point& operator-=(const Point *newPoint) {x -= newPoint->x; y -= newPoint->y; return (*this);}
      21. Point operator+(const Point &other) {Point temp(this); temp += other; return temp;}
      22. Point operator-(const Point &other) {Point temp(this); temp -= other; return temp;}
      23. //comparison
      24. bool operator==(const Point &other) const {return ((x == other.x) && (y == other.y));}
      25. bool operator!=(const Point &other) const {return (!((x == other.x) && (y == other.y)));}
      26. };
      27. //------------------------------------------------------------------------------------------
      28. // This class represents a rectangle
      29. //------------------------------------------------------------------------------------------
      30. class Rect : public tagRECT
      31. {
      32. public:
      33. //long top,left,right,bottom;
      34. //construction
      35. Rect(void) {top = left = right = bottom = 0;}
      36. Rect(long newTop, long newLeft, long newRight, long newBottom) {top = newTop; left = newLeft; right = newRight; bottom = newBottom;}
      37. Rect(Rect &newRect) {top = newRect.top; left = newRect.top; right = newRect.right; bottom = newRect.bottom;}
      38. Rect(Rect *newRect) {top = newRect->top; left = newRect->top; right = newRect->right; bottom = newRect->bottom;}
      39. Rect(Point &topLeft, Point &bottomRight) {top = topLeft.y; left = topLeft.x; right = bottomRight.x; bottom = bottomRight.y;}
      40. //assignment
      41. Rect& operator=(const Rect &newRect) {top = newRect.top; left = newRect.top; right = newRect.right; bottom = newRect.bottom; return (*this);}
      42. Rect& operator=(const Rect *newRect) {top = newRect->top; left = newRect->top; right = newRect->right; bottom = newRect->bottom; return (*this);}
      43. // addition/subtraction
      44. Rect& operator+=(const Rect &newRect) {top += newRect.top; left += newRect.top; right += newRect.right; bottom += newRect.bottom; return (*this);}
      45. Rect& operator-=(const Rect &newRect) {top -= newRect.top; left -= newRect.top; right -= newRect.right; bottom -= newRect.bottom; return (*this);}
      46. Rect& operator+=(const Rect *newRect) {top += newRect->top; left += newRect->left; right += newRect->right; bottom += newRect->bottom; return (*this);}
      47. Rect& operator-=(const Rect *newRect) {top -= newRect->top; left -= newRect->left; right -= newRect->right; bottom -= newRect->bottom; return (*this);}
      48. Rect operator+(Rect &other) {Rect temp(this); temp += other; return temp;}
      49. Rect operator-(Rect &other) {Rect temp(this); temp -= other; return temp;}
      50. // move a rectangle by an amount defined by a Point, keeping the rectanle's size constant
      51. Rect& operator+=(const Point &delta) {top += delta.y; left += delta.x; right += delta.x; bottom += delta.y; return (*this);}
      52. Rect& operator-=(const Point &delta) {top -= delta.y; left -= delta.x; right -= delta.x; bottom -= delta.y; return (*this);}
      53. Rect& operator+=(const Point *delta) {top += delta->y; left += delta->x; right += delta->x; bottom += delta->y; return (*this);}
      54. Rect& operator-=(const Point *delta) {top -= delta->y; left -= delta->x; right -= delta->x; bottom -= delta->y; return (*this);}
      55. Rect operator+(Point &delta) {Rect temp(this); temp += delta; return temp;}
      56. Rect operator-(Point &delta) {Rect temp(this); temp -= delta; return temp;}
      57. //comparison
      58. bool operator==(const Rect &other) const {return ((top == other.top) && (left == other.left) && (right == other.right) && (bottom == other.bottom));}
      59. bool operator!=(const Rect &other) const {return (!((top == other.top) && (left == other.left) && (right == other.right) && (bottom == other.bottom)));}
      60. };
      Display All


      Let me know if you have any questions.

      -Rez
    • Thankyou for your time and consideration,

      the state of the build after adding atltypes.h:

      77 errors

      Here is a sample:

      Error 2 error C2143: syntax error : missing ',' before '&' c:\projects\gamecode
      v2.2\source\interfaces.h 162

      Error 23 error C2143: syntax error : missing ',' before '&' c:\projects\gamecode
      v2.2\source\teapotwars\teapotcontroller.h 54

      Error 36 error C2143: syntax error : missing ',' before '&' c:\projects\gamecode
      v2.2\source\scenegraph\scenenodes.h 584

      Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\projects\gamecode v2.2\source\interfaces.h 162

      Error 22 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\projects\gamecode
      v2.2\source\teapotwars\teapotcontroller.h 54

      Error 33 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\projects\gamecode
      v2.2\source\scenegraph\scenenodes.h 562

      Error 66 fatal error C1083: Cannot open include file: 'resource.h': No such file or directory c:\projects\gamecode v2.2\source\gamecode. 42

      Error 77 fatal error C1083: Cannot open include file: 'resource.h': No such file or directory c:\projects\gamecode v2.2\source\gamecode.h 42

      Error 45 fatal error C1903: unable to recover from previous error(s); stopping compilation c:\projects\gamecode
      v2.2\source\teapotwars\teapotevents.h 54

      Error 11 fatal error RC1015: cannot open include file 'afxres.h'. c:\projects\GameCode
      v2.2\Source\Lang\Strings.rc 10


      I copied your code into a .h file and called it "atltypes.h".
      Is there a specific folder that it needs to go in? Is it supposed to be part of one of the four projects?
      n00b
    • Yes, it needs to be a part of the build. I'd put it in with the engine code somewhere, and make sure the include paths are set up correctly. I would also suggest renaming the file to something other than atltypes.h since you could potentially run into problems if you try to build with a compiler that supports atl.

      Also, note that I named my classes Rect and Point, not CRect or CPoint (I don't like beginning my class names with C). You'll have to either rename my classes to CRect & CPoint or rename all the places in code with my class names. Furthermore, You're going to make a version of CSize since that's used in the code in a few places.

      -Rez
    • by "the engine code," do you mean the folder "main loop"?
      I renamed atltypes.h to atltypesAlt.h,
      put it into the "Main Loop" folder,
      set a path under the options,
      Added it to the Main Loop under the solution explorer,
      I renamed your classes to CPoint and CRect,
      and I do not know how to make a version of CSize.

      I Built the solution and got:

      15 errors
      30 warnings

      here are the unique ones:

      Error 15 error C2558: class 'CRect' : no copy constructor available or copy constructor is declared 'explicit'c:\projects\gamecode
      v2.2\source\dumbstuff\cmath.cpp 574

      Error 40 fatal error C1083: Cannot open include file: 'atlconv.h': No such file or directory c:\projects\gamecode v2.2\source\gamecode.cpp 48

      Error 12 fatal error C1083: Cannot open include file: 'resource.h': No such file or directory c:\projects\gamecode v2. \source\gamecode.h 42

      Error 42 fatal error RC1015: cannot open include file 'afxres.h'. c:\projects\GameCode
      v2.2\Source\Lang\Strings.rc 10

      Warning 36 warning C4996: '_snprintf' was declared deprecated c:\projects\gamecode
      v2.2\source\triggersystem\triggersystemimpl.cpp 633

      Warning 22 warning C4996: '_strlwr' was declared deprecated c:\projects\gamecode
      v2.2\source\resourcecache\zipfile.cpp 195

      Warning 21 warning C4996: '_wfopen' was declared deprecated c:\projects\gamecode
      v2.2\source\resourcecache\zipfile.cpp 141

      Warning 31 warning C4996: 'fopen' was declared deprecated c:\projects\gamecode
      v2.2\source\physics\physicsstream.cpp 13

      Warning 23 warning C4996: 'strcpy' was declared deprecated c:\projects\gamecode
      v2.2\source\resourcecache\zipfile.cpp 218

      Warning 27 warning C4996: 'stricmp' was declared deprecated c:\projects\gamecode
      v2.2\source\physics\physicseventlistener.cpp 72

      Warning 32 warning C4996: 'stricmp' was declared deprecated c:\projects\gamecode
      v2.2\source\triggersystem\triggersystemimpl.cpp 486

      Warning 2 warning C4996: 'wcscat' was declared deprecated c:\projects\gamecode
      v2.2\source\mainloop\initialization.cpp 222

      Warning 20 warning C4996: 'wcscat' was declared deprecated c:\projects\gamecode
      v2.2\source\debugging\minidump.cpp 112

      Warning 17 warning C4996: 'wcsncpy' was declared deprecated c:\projects\gamecode
      v2.2\source\dumbstuff\string.cpp 241

      Again, thank you for your time and consideration
      n00b
    • Error 15 was my mistake. I forget which one was hosed, but here's updated construction section:

      Source Code

      1. //construction
      2. Rect(void) {top = left = right = bottom = 0;}
      3. Rect(long newTop, long newLeft, long newRight, long newBottom) {top = newTop; left = newLeft; right = newRight; bottom = newBottom;}
      4. Rect(const Rect& newRect) {top = newRect.top; left = newRect.top; right = newRect.right; bottom = newRect.bottom;}
      5. Rect(Rect* newRect) {top = newRect->top; left = newRect->top; right = newRect->right; bottom = newRect->bottom;}
      6. Rect(const Point& topLeft, const Point& bottomRight) {top = topLeft.y; left = topLeft.x; right = bottomRight.x; bottom = bottomRight.y;}


      afxres.h and atlconv.h are more ATL files. I'm not sure what's used from them so try and comment them out and see where it chokes. There could be some simple workarounds to requiring those files.

      resource.h should be located in Source/resource.h.

      The deprecation warnings are Microsoft's warnings. You can replace the functions with Microsoft "safe" versions, you can turn off the warnings, or you can simply ignore them.

      Let me know how it works out.

      -Rez
    • Just for reference I got the latest code to compile in Visual C++ 2008 Express Edition today without the physics:

      I used the classes you supplied above with a couple of additions and added the CSize stuff myself. The CSize class only implements the stuff that's actually used and I had to add the BottomRight() and MoveToXY member functions to the CRect class.

      atlconv.h - can be commented out
      afxres.h - make it windows.h instead

      Brainfuck Source Code

      1. //------------------------------------------------------------------------------------------
      2. // This class represents a single CPoint in 2D space
      3. //------------------------------------------------------------------------------------------
      4. class CPoint : public tagPOINT
      5. {
      6. public:
      7. //long x, y;
      8. //construction
      9. CPoint(void) {x = y = 0;}
      10. CPoint(long newX, long newY) {x = newX, y = newY;}
      11. CPoint(const CPoint &newCPoint) {x = newCPoint.x; y = newCPoint.y;}
      12. CPoint(const CPoint *newCPoint) {x = newCPoint->x; y = newCPoint->y;}
      13. //assignment
      14. CPoint& operator=(const CPoint &newCPoint) {x = newCPoint.x; y = newCPoint.y; return (*this);}
      15. CPoint& operator=(const CPoint *newCPoint) {x = newCPoint->x; y = newCPoint->y; return (*this);}
      16. CPoint& operator=(POINT &newCPoint) {x = newCPoint.x; y = newCPoint.y; return (*this);}
      17. // addition/subtraction
      18. CPoint& operator+=(const CPoint &newCPoint) {x += newCPoint.x; y += newCPoint.y; return (*this);}
      19. CPoint& operator-=(const CPoint &newCPoint) {x -= newCPoint.x; y -= newCPoint.y; return (*this);}
      20. CPoint& operator+=(const CPoint *newCPoint) {x += newCPoint->x; y += newCPoint->y; return (*this);}
      21. CPoint& operator-=(const CPoint *newCPoint) {x -= newCPoint->x; y -= newCPoint->y; return (*this);}
      22. CPoint operator+(const CPoint &other) {CPoint temp(*this); temp += other; return temp;}
      23. CPoint operator-(const CPoint &other) {CPoint temp(*this); temp -= other; return temp;}
      24. //comparison
      25. bool operator==(const CPoint &other) const {return ((x == other.x) && (y == other.y));}
      26. bool operator!=(const CPoint &other) const {return (!((x == other.x) && (y == other.y)));}
      27. };
      28. //------------------------------------------------------------------------------------------
      29. // This class represents a CRectangle
      30. //------------------------------------------------------------------------------------------
      31. class CRect : public tagRECT
      32. {
      33. public:
      34. //long top,left,right,bottom;
      35. //construction
      36. CRect(void) {top = left = right = bottom = 0;}
      37. CRect(long newTop, long newLeft, long newRight, long newBottom) {top = newTop; left = newLeft; right = newRight; bottom = newBottom;}
      38. CRect(const CRect& newCRect) {top = newCRect.top; left = newCRect.top; right = newCRect.right; bottom = newCRect.bottom;}
      39. CRect(CRect* newCRect) {top = newCRect->top; left = newCRect->top; right = newCRect->right; bottom = newCRect->bottom;}
      40. CRect(const CPoint& topLeft, const CPoint& bottomRight) {top = topLeft.y; left = topLeft.x; right = bottomRight.x; bottom = bottomRight.y;}
      41. //assignment
      42. CRect& operator=(const CRect &newCRect) {top = newCRect.top; left = newCRect.top; right = newCRect.right; bottom = newCRect.bottom; return (*this);}
      43. CRect& operator=(const CRect *newCRect) {top = newCRect->top; left = newCRect->top; right = newCRect->right; bottom = newCRect->bottom; return (*this);}
      44. // addition/subtraction
      45. CRect& operator+=(const CRect &newCRect) {top += newCRect.top; left += newCRect.top; right += newCRect.right; bottom += newCRect.bottom; return (*this);}
      46. CRect& operator-=(const CRect &newCRect) {top -= newCRect.top; left -= newCRect.top; right -= newCRect.right; bottom -= newCRect.bottom; return (*this);}
      47. CRect& operator+=(const CRect *newCRect) {top += newCRect->top; left += newCRect->left; right += newCRect->right; bottom += newCRect->bottom; return (*this);}
      48. CRect& operator-=(const CRect *newCRect) {top -= newCRect->top; left -= newCRect->left; right -= newCRect->right; bottom -= newCRect->bottom; return (*this);}
      49. CRect operator+(CRect &other) {CRect temp(*this); temp += other; return temp;}
      50. CRect operator-(CRect &other) {CRect temp(*this); temp -= other; return temp;}
      51. // move a CRectangle by an amount defined by a CPoint, keeping the CRectanle's size constant
      52. CRect& operator+=(const CPoint &delta) {top += delta.y; left += delta.x; right += delta.x; bottom += delta.y; return (*this);}
      53. CRect& operator-=(const CPoint &delta) {top -= delta.y; left -= delta.x; right -= delta.x; bottom -= delta.y; return (*this);}
      54. CRect& operator+=(const CPoint *delta) {top += delta->y; left += delta->x; right += delta->x; bottom += delta->y; return (*this);}
      55. CRect& operator-=(const CPoint *delta) {top -= delta->y; left -= delta->x; right -= delta->x; bottom -= delta->y; return (*this);}
      56. CRect operator+(CPoint &delta) {CRect temp(*this); temp += delta; return temp;}
      57. CRect operator-(CPoint &delta) {CRect temp(*this); temp -= delta; return temp;}
      58. //comparison
      59. bool operator==(const CRect &other) const {return ((top == other.top) && (left == other.left) && (right == other.right) && (bottom == other.bottom));}
      60. bool operator!=(const CRect &other) const {return (!((top == other.top) && (left == other.left) && (right == other.right) && (bottom == other.bottom)));}
      61. //Used in Font.cpp
      62. CPoint BottomRight() {CPoint temp(right, bottom); return temp;}
      63. void MoveToXY(int x, int y) {left += x; right += x; top += y; bottom += y;}
      64. void MoveToXY(POINT point) {left += point.x; right += point.x; top += point.y; bottom += point.y;}
      65. };
      66. // CSize impl to fix the issues
      67. class CSize : public tagSIZE
      68. {
      69. public:
      70. //long cx, cy
      71. CSize(void) {cx = cy = 0;}
      72. CSize(long newCx, long newCy) {cx = newCx; cy = newCy;}
      73. CSize(const CSize &initSize) {cx = initSize.cx; cy = initSize.cy;}
      74. CSize(SIZE initSize) {cx = initSize.cx; cy = initSize.cy;}
      75. CSize(POINT initPoint) {cx = initPoint.x; cy = initPoint.y;}
      76. CSize& operator-=(const CSize &newCSize) {cx -= newCSize.cx; cy -= newCSize.cy; return (*this);}
      77. CSize& operator-=(const CSize *newCSize) {cx -= newCSize->cx; cy -= newCSize->cy; return (*this);}
      78. CSize operator-(CSize &other) {CSize temp(*this); temp -= other; return temp;}
      79. };
      Display All