Visual Studio Error. URGENT!

  • me4502
    1st Apr 2011 Member 0 Permalink
    Hi... im getting an error with VS...

    Im sure ive got it all correct

    heres errors

    http://pastie.org/1738773

    most are warning but there are a few errors there.

    most of them say something undeclared but the declaring statement is directly above the code that the error points to...

    EDIT:

    there is nothing wrong with coding... it compiles fine on my mac
  • Xenocide
    1st Apr 2011 Former Staff 0 Permalink
    Errors:
    • 1>src\powder.c(1376): error C2143: syntax error : missing ';' before 'type'
      You've missed a semicolon on line 1375
    • 1>src\powder.c(1377): error C2065: 'neighbors' : undeclared identifier
      You havent told it what neighbors is. You need to declare it.
    • 1>src\powder.c(2976): error C2143: syntax error : missing ';' before 'type'
      You've missed a semicolon on line 2975.
    • 1>src\powder.c(3006): error C2065: 'nb' : undeclared identifier
      You haven't told it what nb is. You need to declare it.


    Warnings:
    Your mixing types a lot, it could make things a bit dodgy.
  • me4502
    1st Apr 2011 Member 0 Permalink
    It compiles fine in both code blocks and on my Mac... I haven't changed the code since. Also I have declared neighbors that's part of GOL and the semicolon is there
  • Pilihp64
    1st Apr 2011 Developer 0 Permalink
    these are errors of MSVC being anal over syntax. you can fix by moving the declaration of these to the beginning of the function, or statement.
    example

    int temp;
    if (temp<7)<br />{
    temp ++
    int prev = temp;
    }

    this would fail to compile on MSVC, just move the declaration to the first line, and delete in 'int' off the other of course.

    int temp,prev;
    ...
    prev = temp;
  • me4502
    1st Apr 2011 Member 0 Permalink
    Ok. Thanks. Ill try it when I get to a computer.