Pages:
Author

Topic: Building headless Bitcoin and Bitcoin-qt on Windows - page 44. (Read 419389 times)

sr. member
Activity: 260
Merit: 251
I mean the wallet works and all but pops out a lot of errors when trying to close it.
Edit:
Works when compiled statically. Tested on both qt 4.8.5 and 5.2.
When I close Compiled altcoin-qt.exe,it crashes,
What can it be?
If you have been following this forum, the original static builds of bitcoin-qt.exe, built and run windows before bitcoin 0.8.5 and 0.8.6 all behaved erratically at exit. The cross compiled pre-built bitcoin-qt.exes that one got from source forge, generally behaved better at exit, though weren't perfect as I remember.

This means that if your *coin-qt.exe implementation is derived from a bitcoin qt sources pre 0.8.5, then you inherit all its capabilities and deficiencies.

The bitcoind.exes prebuilt from source forge may or may not have exited gracefully when commanded to "stop" remotely. I cannot say since I generally use a built on windows from sources bitcoind.exe. For me the bitcoind.exes built on windows exit more gracefully at 0.8.3 and above (0.8.5, 0.8.6) than previous versions.

So again, this means that if your *coind.exe implementation is derived from a bitcoind sources pre 0.8.3, then you inherit all its capabilities and deficiencies.

As an aside, if one has to abort, terminate or kill in some way a bitcoind.exe (and this goes for bitcoin-qt.exe too), there is no code to trap the 5 ways it can occur in Windows. The five ways are:
1. Ctl-C             (not in Qt)
2. Ctl-break       (not in Qt)
3. Close window (not in Qt)
4. Log-off user
5. Windows shutdown
The first two or three are under your control, the other two are not.
If you would like to trap those events, or some of them on Windows7, see message #176, on page 9 of this forum.

Hope this helps

Ron
sr. member
Activity: 293
Merit: 250
So I got everything to compile, and I got the .dll 's that are needed. Now the qt.exe file does not launch and the altcoind.exe just opens a cmd window anythoughts?
full member
Activity: 147
Merit: 100
I mean the wallet works and all but pops out a lot of errors when trying to close it.

Edit:
Works when compiled statically. Tested on both qt 4.8.5 and 5.2.

When I close Compiled altcoin-qt.exe,it crashes,



What can it be?

full member
Activity: 131
Merit: 108
I mean the wallet works and all but pops out a lot of errors when trying to close it.

Edit:
Works when compiled statically. Tested on both qt 4.8.5 and 5.2.
sr. member
Activity: 260
Merit: 251
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 Smiley

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:
 
Code:
#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.html
So with a little jiggery pokery and an application of
Code:
#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:
Code:
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
Code:
set setBlockIndexValid;
invokes its erase method,
Code:
setBlockIndexValid.erase(pindex)
in the function
Code:
InvalidBlockFound(CBlockIndex *pindex){...}
and
Code:
setBlockIndexValid.erase(pindexFailed
in the function
Code:
ConnectBestBlock(CValidationState &state) {...}
If I comment out those two lines, the Release build compiles!?

I have tried various combinations of
Code:
#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 Roll Eyes 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=0

I 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
sr. member
Activity: 293
Merit: 250
This is where I am stuck, all the other ./build\*.o files have no issues and are built correctly. Any thoughts

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d ./build\irc.o
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d ./build\rpcnet.o
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d ./build\crypter.o
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d -lssl
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d -lcrypto
collect2.exe: error: ld returned 1 exit status < SOLVED - new issue below



so this is a new issue I have not seen yet ./build\main.o:main.cpp:(.text+0x20f4): undefined reference to `vnThreadsRunning
'
./build\main.o:main.cpp:(.text+0xaf6e): undefined reference to `fClient'
./build\main.o:main.cpp:(.text+0xeb70): undefined reference to `fClient'
./build\main.o:main.cpp:(.text+0x18d7b): undefined reference to `vnThreadsRunnin
g'
./build\main.o:main.cpp:(.text+0x18ded): undefined reference to `vnThreadsRunnin
g'
./build\main.o:main.cpp:(.text+0x1913a): undefined reference to `vnThreadsRunnin
g'
./build\main.o:main.cpp:(.text+0x19145): undefined reference to `vnThreadsRunnin
g'
./build\main.o:main.cpp:(.text+0x1914d): undefined reference to `vnThreadsRunnin
g'
./build\main.o:main.cpp:(.text+0x1919d): more undefined references to `vnThreads
Running' follow
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: ./build\ma
in.o: bad reloc address 0x2 in section `.text$_ZN5boost6detail17sp_counted_impl_
pINS_8signals26detail12signal2_implIvRK7uint25610ChangeTypeNS2_19optional_last_ v
alueIvEEiSt4lessIiENS_8functionIFvS7_S8_EEENSD_IFvRKNS2_10connectionES7_S8_EEEN S
2_5mutexEE16invocation_stateEED1Ev[__ZN5boost6detail17sp_counted_impl_pINS_8sign
als26detail12signal2_implIvRK7uint25610ChangeTypeNS2_19optional_last_valueIvEEi S
t4lessIiENS_8functionIFvS7_S8_EEENSD_IFvRKNS2_10connectionES7_S8_EEENS2_5mutexE E
16invocation_stateEED1Ev]
full member
Activity: 131
Merit: 108
I installed an compiled Bitcoin-qt after about a week and it works fine.

I tried to follow the direction to build the foocoin/barcoin QT but I keep getting this error:

src/util.h: At global scope:
src/util.h:555:16: error: conflicting declaration 'typedef void* pthread_t'
 typedef HANDLE pthread_t;


any idea how to fix this?


See relevant patch here:
https://github.com/laanwj/bitcoin/commit/61d85071405b99c3734606eed31ea8f615c0c77a
full member
Activity: 131
Merit: 108

I've seen that also, however I couldn't reproduce the problem (it just worked like the previous versions did).
Did you need the workaround to compile boost? If so what are your system specs?
gsc
newbie
Activity: 24
Merit: 0
After closing the compiled Windows-QT it crashes and I get runtime error 'The application has requested the Runtime to terminate in an unusual way'

Checking Eventviewer on the crash I can see mini-crashes:

The Open Procedure for service "MSDTC" in DLL "C:\Windows\system32\msdtcuiu.DLL" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "Lsa" in DLL "C:\Windows\System32\Secur32.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "ESENT" in DLL "C:\Windows\system32\esentprf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "BITS" in DLL "C:\Windows\System32\bitsperf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.


Any ideas? I've been scratching my head for about 10 hours now Sad
Is this for Litecoin? I am getting that error for the LTC wallet upon closing.

Maybe the windows problem? I donate 1000 GSC for fix.
newbie
Activity: 41
Merit: 0
I installed an compiled Bitcoin-qt after about a week and it works fine.

I tried to follow the direction to build the foocoin/barcoin QT but I keep getting this error:

src/util.h: At global scope:
src/util.h:555:16: error: conflicting declaration 'typedef void* pthread_t'
 typedef HANDLE pthread_t;


any idea how to fix this?


newbie
Activity: 13
Merit: 0
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.
member
Activity: 84
Merit: 10

2.3 Boost: http://sourceforge.net/projects/boost/files/boost/1.55.0/
Unpack boost inside your C:\deps folder, then bootstrap and compile from a Windows command prompt:
Code:
cd C:\deps\boost_1_55_0\
bootstrap.bat mingw
b2 --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread toolset=gcc stage

bootstrap.bat mingw is broken for boost 1_55.

fix: https://groups.google.com/d/msg/boost-developers-archive/hVNKGbZcXs0/fIh-iK-DVOMJ

Quote
Adding an empty!! new line in

$BOOSTDIR/tools/build/v2/engine/build.bat

in line 93 right before:
:Guess_Toolset

and here is precompiled qt-5.2: http://www.nic.funet.fi/pub/mirrors/download.qt-project.org/official_releases/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-mingw48_opengl-x86-offline.exe
newbie
Activity: 24
Merit: 0
Following your tips, I've compiled BITCOIN0.8.6 on windows with qt 4.8.5(release version).
But the program 'bitcoin-qt' crash when run.
member
Activity: 66
Merit: 10
Code:
include" -o obj/rpcnet.o rpcnet.cpp
In file included from compat.h:17:0,
                 from netbase.h:11,
                 from net.h:19,
                 from rpcnet.cpp:5:
c:\mingw\include\ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible wi
th winsock.h. Include winsock2.h instead."
 #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead
."
  ^
In file included from compat.h:17:0,
                 from netbase.h:11,
                 from net.h:19,
                 from rpcnet.cpp:5:
c:\mingw\include\ws2tcpip.h:147:8: error: redefinition of 'struct ip_mreq'
 struct ip_mreq {
        ^
In file included from c:\mingw\include\windows.h:93:0,
                 from c:/deps/openssl-1.0.1e/include/openssl/rand.h:67,
                 from net.h:11,
                 from rpcnet.cpp:5:
c:\mingw\include\winsock.h:315:8: error: previous definition of 'struct ip_mreq'

 struct ip_mreq {
        ^
In file included from compat.h:17:0,
                 from netbase.h:11,
                 from net.h:19,
                 from rpcnet.cpp:5:
c:\mingw\include\ws2tcpip.h:390:13: error: expected initializer before 'freeaddr
info'
 void WSAAPI freeaddrinfo (struct addrinfo*);
             ^
c:\mingw\include\ws2tcpip.h:391:12: error: expected initializer before 'getaddri
nfo'
 int WSAAPI getaddrinfo (const char*,const char*,const struct addrinfo*,
            ^
c:\mingw\include\ws2tcpip.h:393:12: error: expected initializer before 'getnamei
nfo'
 int WSAAPI getnameinfo(const struct sockaddr*,socklen_t,char*,DWORD,
            ^
makefile.mingw:124: recipe for target 'obj/rpcnet.o' failed
mingw32-make: *** [obj/rpcnet.o] Error 1

C:\currencies\bitcoin-0.8.6\src>

The above wall of text appears every time it comes to compiling bitcoind (at part 3.3) when using mingw32-make -f makefile.mingw

Has anybody come across this issue or have any idea how it can be resolved? I've followed the tutorial to the letter and spent ages googleing various parts of the long list of errors, but can't find a solution. Any help would be greatly appreciated.

**EDIT**

It is working now. Went back to square one and removed all of the minGW stuff and everything that was unpacked in the depenencies folder.

If there was an issue, I suspect I hadn't done the config right the first time at part 2.4.

The tutorial is absolutely brilliant but misses a minor step, which tripped me up. At step 2.4, it ideally should say after "after renaming 'miniupnpc-1.8" to "miniupnpc':

Code:
cd C:\deps\miniupnpc
mingw32-make -f Makefile.mingw init upnpc-static

legendary
Activity: 1344
Merit: 1000
Same problem with crashing on exit, like above.

 Huh Huh Huh
newbie
Activity: 42
Merit: 0
Is anyone able to compile a Windows wallet for Nutcoin please?

https://github.com/dmx374/nutcoin
member
Activity: 84
Merit: 10
anybody was able to run through gitian builds for windows?
member
Activity: 84
Merit: 10


The only problem now is when I close the wallet I get this:



having the exact same situation. managed to fix it? I'm also on litecoin 0.8.6.1
and it'll also be not sending coins Smiley
full member
Activity: 224
Merit: 100
DigiByte Founder
After closing the compiled Windows-QT it crashes and I get runtime error 'The application has requested the Runtime to terminate in an unusual way'

Checking Eventviewer on the crash I can see mini-crashes:

The Open Procedure for service "MSDTC" in DLL "C:\Windows\system32\msdtcuiu.DLL" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "Lsa" in DLL "C:\Windows\System32\Secur32.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "ESENT" in DLL "C:\Windows\system32\esentprf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "BITS" in DLL "C:\Windows\System32\bitsperf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.


Any ideas? I've been scratching my head for about 10 hours now Sad
Is this for Litecoin? I am getting that error for the LTC wallet upon closing.
member
Activity: 112
Merit: 10
After closing the compiled Windows-QT it crashes and I get runtime error 'The application has requested the Runtime to terminate in an unusual way'

Checking Eventviewer on the crash I can see mini-crashes:

The Open Procedure for service "MSDTC" in DLL "C:\Windows\system32\msdtcuiu.DLL" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "Lsa" in DLL "C:\Windows\System32\Secur32.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "ESENT" in DLL "C:\Windows\system32\esentprf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.

The Open Procedure for service "BITS" in DLL "C:\Windows\System32\bitsperf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code.


Any ideas? I've been scratching my head for about 10 hours now Sad
Pages:
Jump to: