DosX-dev / TinySnake-game

Little game "Snake" for Windows in C (.EXE size is 3.5 kilobytes)
https://dosx.su
MIT License
175 stars 5 forks source link

EXE works, code doesnt #1

Open javakotlinuser opened 1 month ago

javakotlinuser commented 1 month ago

I tried executing the code with VSCode's Terminal and the real one, but yet i get this error (gcc): snake.c:11:9: warning: "FOREGROUND_BLUE" redefined 11 | #define FOREGROUND_BLUE 0x01 | ^~~~~~~ In file included from C:/msys64/mingw64/include/windows.h:74, from snake.c:8: C:/msys64/mingw64/include/wincon.h:119:9: note: this is the location of the previous definition 119 | #define FOREGROUND_BLUE 0x1 | ^~~~~~~ snake.c:12:9: warning: "FOREGROUND_GREEN" redefined 12 | #define FOREGROUND_GREEN 0x02 | ^~~~ C:/msys64/mingw64/include/wincon.h:120:9: note: this is the location of the previous definition 120 | #define FOREGROUND_GREEN 0x2 | ^~~~ snake.c:13:9: warning: "FOREGROUND_RED" redefined 13 | #define FOREGROUND_RED 0x04 | ^~~~~~ C:/msys64/mingw64/include/wincon.h:121:9: note: this is the location of the previous definition 121 | #define FOREGROUND_RED 0x4 | ^~~~~~ C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-crtexewin.o): in function main': C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexewin.c:67:(.text.startup+0xbd): undefined reference toWinMain' collect2.exe: error: ld returned 1 exit status

DosX-dev commented 1 month ago

Hello! Use TinyC Compiler (TCC)

tcc snake.c -m32
javakotlinuser commented 1 month ago

got it