Like the Title says I need to make code::blocks
to work with C11
and I can't figure out how to do it.
I went to settings
=> compiler settings
=> Other options
and I added -std=c11
and tried also with -std=gnu11
, both doesn't seems to work.
I compiled gcc-5.2
and then I changed the default compiler (gcc-4.9) and still no result.
When I try to compile the following program:
#include<stdio.h>
int main(void){
int arr[] = {0,1,2,3,4};
for(int i=0;i<5;i++){
printf("%d ",arr[i]);
}
return 0;
}
I get the following:
|6|error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode|
But if I do it in terminal (ubuntu 15.04, 64BIT, gcc-5.2):
./install/gcc-5.2.0/bin/gcc5.2 program.c -o program
Seems to work fine.
My question is, how to make code::blocks
to work with c11
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…