taylorconor/tinytetris

make error

Closed this issue · 1 comments

wenc@wenc-virtual-machine:~/hellogithub/tinytetris$ make
g++ tinytetris.cpp -lcurses -o tinytetris
tinytetris.cpp: In function ‘I F()’:
tinytetris.cpp:10:73: error: ISO C++ forbids declaration of ‘z’ with no type [-fpermissive]
+y][N(r,(i2)+2)+x]=v;}I F(){for(I c=0;c<20;c++){move(1+c,1);for(auto &z:a[c]){
^
tinytetris.cpp:10:75: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11
+y][N(r,(i
2)+2)+x]=v;}I F(){for(I c=0;c<20;c++){move(1+c,1);for(auto &z:a[c]){
^
tinytetris.cpp: In function ‘I R()’:
tinytetris.cpp:14:12: error: ISO C++ forbids declaration of ‘z’ with no type [-fpermissive]
;for(auto &z:a[q])c*=z;if(!c)continue;for(I c=q-1;c>0;c--)memcpy(&a[c+1][0],&a[
^
tinytetris.cpp:14:14: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11
;for(auto &z:a[q])c*=z;if(!c)continue;for(I c=q-1;c>0;c--)memcpy(&a[c+1][0],&a[
^
: recipe for target 'tinytetris' failed
make: *** [tinytetris] Error 1

This is because "c++11" problem, just add in the Makefile:
LDFLAGS=-std=c++11