Im on VIM text editor and when I try running :!gcc -o output solver.c
to run a C source file (i hope thats the correct command line) I keep getting this message in the terminal:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.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
And I get this message for any gcc
command. Here is the simple solver.c
file that im running:
#include <stdio.h>
int main(){
printf("Hello World!");
return 0;
}
I tried asking ChatGPT (it was worth a shot) and it gave me gcc commands to enter to fix my issue but were all just returning the same long error message.
Miggy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.