   Oh noz syntax error1!!1!!
  I''m working through the OpenGL tutorials at NeHe and have come across a problem.  This problem has nothing to do with game programming, I just thought I''d announce the context of my code.  Here is the problematic C code itself:   //Vertex with coordinates x,y,z, and texture coordinates u,vtypedef struct tag_VERTEX{float x, y, z;float u, v;} VERTEX;//Triangle with 3 verticestypedef struct tag_TRIANGLE{VERTEX vertex[3];} TRIANGLE;//Sector has a pointer to an array of trianglestypedef struct tag_SECTOR{int numtriangles;TRIANGLE * tri;} SECTOR;//Declare a global sectorSECTOR sector1;  ///LINE 97///Yeah, so the compiler complains about a syntax error on line 97: "missing '';'' before identifier ''sector1''".  It''s the only compiler error in my program.  It doesn''t make any sense to me,  but then again I''m not a C grandmaster.  I''m sure there are some people out there who can claim that status.I would greatly appreciate any help with this.  Does it have anything to do with nested structs?  Am I accidentally using super-obscure C keywords?  Or do you need to see more code? 
  There''s no coding problem there. I even copied and pasted and compiled to make sure. It must be a missing braket, semi colon, or quantity early on in your code. There like 70 lines before that code snippet, I would look there. ;  I find that strange because no matter where I move the line that declares sector1 in my code, I still get the syntax error at that line. ;  Seeing as you want to create a global SECTOR variable then why not do something like this:typedef struct tag_SECTOR{    int numtriangles;    TRIANGLE * tri;} Sector1;   This prevents you from having to declare SECTOR Sector1 as you are declaring a variable of the struct when you are defining the actual struct.   [edited by - Spudder on February 18, 2004 5:06:16 PM];  Did you do a "#define SECTOR something" or something similar in your code? If so, this is likely to produce this error. ;  Well, I rewrote the entire thing, and this time got no errors.  Started from scratch.  I guess I''ll never know what went wrong, but I don''t really care.  It works, yay! ;  Sometimes with Visual C++ it''s necessary to do a Rebuild All or you get bugs like this. It has nothing to do with the code.   ~CGameProgrammer( ); -- Post screenshots of your projects. There''s already 134 screenshot posts. ;quote:Original post by Spudder  Seeing as you want to create a global SECTOR variable then why not do something like this:typedef struct tag_SECTOR{    int numtriangles;    TRIANGLE * tri;} Sector1;    This prevents you from having to declare SECTOR Sector1 as you are declaring a variable of the struct when you are defining the actual struct.No, that''s wrong. Because of the "typedef" command, the above code is just like "typedef tag_SECTOR Sector1" except it first defines what tag_SECTOR is. If you remove the word "typedef" then you would be right.   ~CGameProgrammer( ); -- Post screenshots of your projects. There''s already 134 screenshot posts.    