Undefined reference to `WinMain' collect2.exe: error: ld returned 1 exit status

I’ve installed the Mingw compiler and I am writing in Visual Studio. Whenever I run a C program it comes up with the same error: undefined reference to `WinMain’ collect2.exe: error: ld returned 1 exit status

I have absolutely no idea what the issue is and any help is appreciated. Thank you.