Because it hasn't been mentioned yet, this was the solution for me:
I had this error with a DLL after creating a new configuration for my project. I had to go to Project Properties -> Configuration Properties -> General
and change the Configuration Type
to Dynamic Library (.dll)
.
So if you're still having trouble after trying everything else, it's worth checking to see if the configuration type is what you expect for your project. If it's not set correctly, the compiler will be looking for the wrong main symbol. In my case, it was looking for WinMain
instead of DllMain
.