Friday, September 23, 2011

How to fix 'for' loop initial declarations are only allowed in C99 mode in Eclipse

For loop problem
Once again, programming in C using Eclipse in Linux is great, however when using "for" loops I get this error:
'for' loop initial declarations are only allowed in C99 mode
After a little bit of research, in Eclipse, go to Project > Properties > C/C++ Build > Settings > GCC C Compiler > Miscellaneous > add "-std=c99" to the "Linker Flags" text field.
http://www.eclipse.org/forums/index.php?t=msg&goto=212981&

3 comments:

  1. Yeah, haha, when I first ran into this I was puzzled.

    ReplyDelete
  2. online user counter many thanks to do this part, that i learn latest elements.

    ReplyDelete
  3. Thanks for the post. There is a lot of posts out there on this errors which are not accurate

    ReplyDelete

Please make suggestions :)