I first installed mingw into my system and added it to the path. It worked. Showing version when I type gcc --version
in cmd.
Then I reinstalled VS Code, then installed C/C++ Intellisense Extension and Code Runner Extension into the VS Code.
After that, when I am writing even simple Hello World Programs, it is displaying an error as follows.
PS E:\C Programming> cd "e:\C Programming\" ; if ($?) { gcc hello-world.c -o hello-world } ; if ($?) { .\hello-world }
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
PS E:\C Programming>
What does all this mean? How can this be fixed?