0

I wanted to compile C by MinGW in Visual Studio Code, but I got an error code at the terminal. I completely installed MinGW and copied its path to paste it into the path. This the error code in the compiler-

PS C:\Users\ariji\Documents\C C++> cd "c:\Users\ariji\Documents\C C++\" ; if ($?) { gcc main.c -o main } ; if ($?) { .\main }
C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.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
Gerhardh
  • 11,688
  • 4
  • 17
  • 39
Arijit
  • 1
  • 1
  • Welcome to SO. As with most output you should read it from top to bottom, not only the last line. If you do this, your question should be about "undefined reference to `WinMain@16'" which probably will result in many hits if you search for it. – Gerhardh Apr 30 '21 at 06:27
  • 1
    Does this answer your question? [undefined reference to \`WinMain@16'](https://stackoverflow.com/questions/5259714/undefined-reference-to-winmain16) – Gerhardh Apr 30 '21 at 06:28

0 Answers0