VS 2008 error C2059 and C2238

closed account (j2y5fSEw)
I'm trying to port a C++/openGL/SDL/Boost project that was developed on linux to windows 7 with VS 2008. 
I've solved a lot of compile error and various other things VS C++ compiler complained about but I'm kind of stuck on this one.

I get error code C2059 and C2238. The actual error messages are:

1
2
3
4
5
6
7
8
Error	1	error C2059: syntax error : ';'	d:\College\AsteroidBlaster\Utility\ViewFrustum.h	37
Error	2	error C2238: unexpected token(s) preceding ';'	d:\College\AsteroidBlaster\Utility\ViewFrustum.h	37
Error	3	error C2059: syntax error : ';'	d:\College\AsteroidBlaster\Utility\ViewFrustum.h	38
Error	4	error C2238: unexpected token(s) preceding ';'	d:\College\AsteroidBlaster\Utility\ViewFrustum.h	38
Error	5	error C2059: syntax error : ';'	d:\College\AsteroidBlaster\Utility\ViewFrustum.h	37
Error	6	error C2238: unexpected token(s) preceding ';'	d:\College\AsteroidBlaster\Utility\ViewFrustum.h	37
Error	7	error C2059: syntax error : ';'	d:\College\AsteroidBlaster\Utility\ViewFrustum.h	38
Error	8	error C2238: unexpected token(s) preceding ';'	d:\College\AsteroidBlaster\Utility\ViewFrustum.h	38


Here is ViewFrustum.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
 * viewFrustum: It's got useful functions to cull items that aren't in your view frustum
 * 
 * 2-7-11
 * CPE ---
 */
 
#ifndef __VIEW_FRUSTUM_H__
#define __VIEW_FRUSTUM_H__

#include "Items/Object3D.h"
#include "Utility/Plane.h"
#include "Utility/Matrix4.h"
#include <vector>
#include <set>

class ViewFrustum {
   public:
      
      ViewFrustum();
      virtual ~ViewFrustum();
      
      /* Takes in a list of all the Object 3D's around, and culls them down to only the ones
       * that are inside the view frustum.
       */
      virtual std::list<Drawable*>* cullToViewFrustum(std::vector<Drawable*>* all, bool skipParticles);
      virtual std::list<Object3D*>* cullToViewFrustum(std::vector<Object3D*>* all);
      
      /* Prints out details about all of the planes of the view frustum.
       */
      virtual void print();

   private:
      Matrix4 projMatrix;
      Matrix4 modelViewMatrix;
      Plane* top;
      Plane* bottom;
      Plane* left;
      Plane* right;
      Plane* near;
      Plane* far;

      /** 
       * A modified version of chedDrawableOutside, used by the AI. This stops the
       * AI from targeting Drawable objects which are slightly outside the field
       * of view, which still need to be drawn.
       */
      bool checkTargetableOutside(Drawable* obj);

      /* Returns true if the Drawable object is completely outside of the 
       * view frustum planes.
       * Returns false if it's even part-way inside.
       */
      virtual bool checkDrawableOutside(Drawable* obj);
};

#endif 


I'm kind of confused why a pointer to Plane class would cause this kind of error. I've tried Googling with no luck.
If anyone has any idea why this is, please let me know.
If you need more code posted, please let me know.
Last edited on
Which lines are 37, 38 ? Surely not the comments..
closed account (j2y5fSEw)
Oops my bad, 37-38 are the following lines:
1
2
      Plane* bottom;
      Plane* left;


Fixed the original post so that this is reflected.
Last edited on
closed account (j2y5fSEw)
Fixed the problem, posted here: http://stackoverflow.com/questions/6086383/vs-2008-c-error-c2059-and-c2238

Basically, I just had to change the variable names far and near because it's used by Windows.h
That's weird. I took your code, wrote the necessary declarations/definitions (the ones in your other headers) and it compiled fine..
Topic archived. No new replies allowed.