My God...it...it works!! Built correctly the first time and is now running and synchronizing with the network (196 weeks behind at time I write this).
Much thanks to the OP for this build guide!
Next step is to learn the development tools for working with Linux code and build system on a Windows 7 machine. I've been a MS Visual Studio monkey for most of my life so I have some learning to do.
Hello nondescriptmale,
From one to another
See message #230 here in this forum, this link:
https://bitcointalksearch.org/topic/m.3915582 will get you to page 12, but #230 is in there.
I too have no trouble building a gcc version of bitcoind and bitcoin-qt on windows. But then again, if you've read my previous posts, I tend to stay with what works, that is the versions of gcc (no longer available, or hard to find), Boost, and Qt that were available last spring and summer.
My goal is to run bitcoind.exe as a MSVC++ build, Release and Debug, statically linked (/MT and /MTd). All is well, except for a couple of items.
As an update to everyone else who might be interested:
1. Static libraries for Boost, OpenSSL, BerkeleyDB and levelDB (1.13) are easy to make, when you know how! I am speaking of MSVC++ .lib static libraries, not gcc static libraries, though there isn't that much difference except in the ABIs.
I am thinking of making some short videos,
u-toob style on the libraries, since the text seems so inappropriate when just showing what to click in the IDE, and why, is much easier.
2. levelDB 1.13 appears to remove .sst files from its LRU cache when the DBImpl::Get(...) is called, but the rest of levelDB isn't notified! I commented out the lines near the end of the DBImpl::Get(), that look like this in db_impl.cc:
#ifdef _MSC_VER
#else
if (have_stat_update && current->UpdateStats(stats))
{
MaybeScheduleCompaction(); // killed here
}
#endif
and now I can finally do a startup VerifyDB() at level 3 and above.
3. MSVC++ is basically C++2003 with P.J. Plauger's Dinkumware libraries, see:
http://www.tech-archive.net/Archive/VC/microsoft.public.vc.stl/2005-10/msg00030.htmlSo with a little
jiggery pokery and an application of
#ifdef _MSC_VER
#define _HAS_STRICT_CONFORMANCE 0
#endif
I am able to compile and run a Debug version of bitcoind.exe, stand-alone no dlls
4. The release compile of the identical code, emits a mystical:
Microsoft Visual Studio 8\VC\include\xtree(1174) : error C3848:
expression having type 'const CBlockIndexWorkComparator'
would lose some const-volatile qualifiers in order to call
'bool CBlockIndexWorkComparator::operator ()(CBlockIndex *,CBlockIndex *)'
upon noticing that the (global) set in main.cpp
set setBlockIndexValid;
invokes its erase method,
setBlockIndexValid.erase(pindex)
in the function
InvalidBlockFound(CBlockIndex *pindex){...}
and
setBlockIndexValid.erase(pindexFailed
in the function
ConnectBestBlock(CValidationState &state) {...}
If I comment out those two lines, the Release build compiles!?
I have tried various combinations of
#define _HAS_IMMUTABLE_SETS 0
and other such to no avail.
If anyone can shed some C++ light on sets, .erase, etc. I might be able to get a screaming fast bitcoind.exe going. I say that because the Debug version seems as fast as the gcc version?
It is really instructive to see where the C++ code goes, live in real time, in the IDE, when a function or method is called with complicated arguments, and which overloaded operator is invoked with certain assignments!
Also, for all you gcc-ers, there is an awful lot of implicit casting being done! At least MSVC++ thinks so.
BTW, all you *coin lurkers, if you've snagged the bitcoin sources pre levelDB, which it seems quite few have, you can do this to your sources too and have nice alternative windows versions! I only say this since I "honed" my static library building skills "making" one of those *coins
since there was so little interest here, when I first posted those screens. But I'm back here now. Sometimes it isn't the best technology that prevails, but the one with the nicest implementation or the most advertising! Think of Beta-Max vs VHS, Windows vs OS2, etc.
That is why I'm trying to offer an alternative build platform for Windows. The bitcoin source is the same. Not changed at all. Except with changes as above. It should (famous last words) be easier to pretty up a windows version in MSVC than in Qt. At least it seems so to me at this time. Qt is fine but it seems to have a lot of compatibility issues with its compiler, its libraries, etc.
Think of how many more "desktops" one could attract. See
http://www.netmarketshare.com/operating-system-market-share.aspx?qprid=10&qpcustomd=0I see that bitcoin has gone from levelDB 1.9(2011) (bitcoin 0.8.1, 0.8.2, 0.8.3) to levelDB 1.12 (biticoin 0.8.4 & 0.8.5) and levelDB 1.13 (bitcoin 0.8.6). Just wondering if there's any reason, since the levelDB "issues"
http://code.google.com/p/leveldb/issues/list makes for
interesting reading!
Ron