0

code:

#include<stdio.h>
int main(void)
{   
    printf(" hello world\n");
    return 0;
}   

error:

C:/Program Files (x86)/mingw-w64/i686-5.2.0-posix-dwarf-rt_v4-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.2.0/../../../../i686-w64-mingw32/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x39): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status

I use a GCC compiler.

  • Welcome to SO. Please read your messages from top to bottom and start with first error. You get a "undefined reference to `WinMain@16'" error. Every error that is shown later is likely a result of that error. – Gerhardh Aug 11 '21 at 09:18
  • 1
    Does this answer your question? [undefined reference to \`WinMain@16'](https://stackoverflow.com/questions/5259714/undefined-reference-to-winmain16) – Gerhardh Aug 11 '21 at 09:19

0 Answers0