Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXE works, code doesnt #1

Open
javakotlinuser opened this issue Jul 15, 2024 · 2 comments
Open

EXE works, code doesnt #1

javakotlinuser opened this issue Jul 15, 2024 · 2 comments

Comments

@javakotlinuser
Copy link

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 to WinMain'
collect2.exe: error: ld returned 1 exit status

@DosX-dev
Copy link
Owner

Hello! Use TinyC Compiler (TCC)

tcc snake.c -m32

@javakotlinuser
Copy link
Author

got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants