   Code porting issue
  Alright, im trying to compile some code written on unix (codeblocks/gc++/ubuntu) under windows(codeblocks, tried vc2008 and mingw compilers, vista 32b). These are some of my own little projects and I dont have any SVN for these so I just read them from my external disk. The code which gives me errors is the following:void resize(int width, int height) //line 28{    float aspectRatio = (float) width / (float) height;    float top    = 1.0f;    float bottom = -1.0f;    float near   = 2.0f;  // line 33    float far    = 200.0f;    glViewport(0, 0, width, height);    glMatrixMode(GL_PROJECTION);    glLoadIdentity();    // line 38    glFrustum(-aspectRatio, aspectRatio, bottom, top, near, far);    mainCamera->aspectRatio = aspectRatio;    mainCamera->fieldOfView = atan( aspectRatio * 2 / near );    glMatrixMode(GL_MODELVIEW);//line 43    glLoadIdentity() ;}and error log:...\core\glmain.cpp||In function `void resize(int, int)':|...\core\glmain.cpp|33|error: expected unqualified-id before '=' token|...\core\glmain.cpp|34|error: expected unqualified-id before '=' token|...\core\glmain.cpp|40|error: expected primary-expression before ',' token|...\core\glmain.cpp|40|error: expected primary-expression before ')' token|...\core\glmain.cpp|42|error: expected primary-expression before ')' token|||=== Build finished: 5 errors, 0 warnings ===|I suspected problems with line endings so I used fixEOL.exe (found with google) but that didnt work, either the tool doesnt work or there is something else going on here...thanks in advance[Edited by - Defeatist on May 19, 2010 8:54:00 AM]
Quote:...\core\glmain.cpp|33|Line 33 doesn't mean much without line numbers present in code snippet...   ;Quote:Original post by AntheusQuote:...\core\glmain.cpp|33|Line 33 doesn't mean much without line numbers present in code snippet...shouldve added those! line 33 is float near   = 2.0f;Ill update the original post now   ;  I'm guessing your compiler reserves `near' and `far' for qualifying pointers in certain memory models. This is non-standard behavior and there should be some way to disable it. If there isn't, just change the variable names.   ;  Or they might have been #define'd somewhere; try '#undef near'.   ;  ahh, turns out that one of the libraries I use (I think its freeglut) includes windef.h somewhere, which in turn defines a 'far' and and 'near' symbol. I renamed them clipNear and clipFar and it works. Thanks for the help!   