To compile Emacs on a 64-bit version of Windows 7 or newer, we recommend to use the MinGW-w64 port of GCC and Binutils with the MSYS2 suite of tools. For the details, see the file nt/INSTALL.W64 in the Emacs source distribution.
If you need to build or run Emacs on MS Windows before Windows 7, you have to use the MinGW port of GCC and the MSYS suite of tools. The file nt/INSTALL in Emacs source distribution contains the details.
Support for displaying images, as well as XML/HTML rendering and TLS networking requires external libraries, the headers and import libraries for which will need to be installed where your compiler can find them. Again, the details, including URLs of sites where you can download these libraries are in nt/INSTALL.W64 or nt/INSTALL. See Other useful ports, for auxiliary tools you may wish to install and use in conjunction with Emacs.
After unpacking the source, or checking out of the repository, be sure to read the instructions in nt/README and the respective install file.