[Solved] VScode Error: undefined reference to ‘WinMain’ collect2.exe: error: ld returned 1 exit status

This is because vs code will not be saved automatically after you click Run. You need to save it by Ctrl + S
if it is not saved, a dot will be displayed

Read More: