0

I recently installed Visual studio alongside gcc, g++ and gdb. And when i wanted to test a simple code like:

#include <stdio.h>


int main(){

    printf("lol");
    
    return 0;
}

I get the following output :

 [Running] cd "c:\Users\ADMIN\Desktop\CS\" && gcc test.c -o test && "c:\Users\ADMIN\Desktop\CS\"test
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
  • 3
    The main part of the error message is "undefined reference to `WinMain'". My recommendation is that you do some research about it, perhaps putting it into your favorite search engine and see what hits you get. – Some programmer dude Mar 24 '21 at 13:22
  • 1
    Does this answer your question? [undefined reference to \`WinMain@16](https://stackoverflow.com/questions/20909816/undefined-reference-to-winmain16) – underscore_d Mar 24 '21 at 13:26

0 Answers0