I spent some time today trying to get Bitcoin to compile with MSVC2010. Eventually got it to work nicely. I'll publish the solution and build files this week.
However there were quite some surprises:
- Define
WIN32_LEAN_AND_MEANin serialize.h to prevent winsock compile errors. - CService::SetPort, was mysterious unresolved external. Turned out to be a macro issue, windows defines SetPort
- strprintf problem: http://stackoverflow.com/questions/222195/are-there-gotchas-using-varargs-with-reference-parameters
- works in g++, but in MSVC causes horrible crashes.
NOMINMAXneeds to be defined before include of windows.h to prevent windows from defining min and max macros, and std::min and std::max from causing compile errorspid_tneeds to be defined for compatibility
All these are fixed in this patch. The changes are trivial.
This still builds in Linux, however I still need to test whether this doesn't break the gitian cross-compile.