Is there any specific reason for asking this question or is it just a general enquiry?
I ask because yes it's possible but you may need to take additional steps to do so e.g. change the compiler, change variables, etc.
Note that cross-compilation isn't uncommon, not just with Windows but with various other platforms e.g. mobile apps.