C99 ERROR (Unix and C)

Discussion in 'Programming' started by david_sakh, Jan 19, 2006.

  1. #1
    I'm not sure which build option will help me solve this problem. Initializations in for loops causes this error when I try to run a c program on my unix machine.

    I was told that:

    This can be fixed by changing the C Language Dialect option in your project's build settings to C99 or GNU99

    how do i do this?
     
    david_sakh, Jan 19, 2006 IP
  2. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That depends entirely on what compiler you are using. You would have to check the documentation to see what command line switch controls the C dialet. In GCC, for instance, it would be -std=c99. You could also post the code with the error. Perhaps the solution is something more simple.
     
    FeelLikeANut, Jan 20, 2006 IP
    david_sakh likes this.
  3. TMan

    TMan Peon

    Messages:
    126
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think I've once had a problem similar to this. My guess is you are trying to do something like:

    for (int a = 0; a < 10; a ++)
    Code (markup):
    If that's the case, changing this to:

    int a;
    for (a = 0; a < 10; a ++)
    Code (markup):
    May solve your problem.
     
    TMan, Jan 23, 2006 IP