bitcoin-qt.pro as it is doesn't let Qt Creator create a working Makefile.
Currently the creation of build.h has to be done manually, and the "genbuild.depends = FORCE" line needs the FORCE removing.
I observed this, too ... I comment the build-stuff out to get this working, but a real fix would be a great thing!
Strange, that part of the file is inside a !windows block. I wonder why it gets evaluated.
@sipa Yeah that's strange, but it won't compile with that part enabled ...
@Diapolo Have you got it compiling on Windows recently? I'm getting:
e:/nokiaqtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x13f): undefined reference to `shutdown@8'
e:/nokiaqtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x3af): undefined reference to `shutdown@8'
a problem in openssl?
Yes I'm compiling fine on Windows but had to change a few things in the pro file.
Edit: You extracted the pre-compiled needed lib package into the MinGW dir? See: https://github.com/bitcoin/bitcoin/blob/master/doc/readme-qt.rst
And this dependency package badly needs an update ... but no one seems to be able to do this or remember, who created it.
put ws2_32 and shlwapi libraries after ssl and crypto
@mhredmond21 It would be good to know what is the best / safest ordering to add libs in the .pro file. I got it working for myself and currently have:
windows:LIBS += -lshlwapi
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
windows:LIBS += -lws2_32 -lole32 -loleaut32 -luuid -lgdi32
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
I needed to add -loleaut32, dunno what needed this, could be boost 1.49. And I needed to re-order another one. This compiles just fine, but I'm not that sure about the ordering ...
I finally got my bitcoin-qt working. Thanks Diapolo for your hints.
instructions to build bitcoin-qt on windows --
Get the QT Windows SDK
get master branch from github (I used EGit that comes with eclipse)
http://download.visucore.com/bitcoin/qtgui_deps_1.zip << download this, but the boost package is too old
https://bitcointalk.org/index.php?topic=77235.msg863514 << follow these instructions (from diapolo) to build boost
edit bitcoin-qt.pro in the root of the bitcoin branch
add these lines where it says in comments (adjust to your hard drive layout )
BOOST_INCLUDE_PATH = "E:\boost-1.47.0-mgw"
BOOST_LIB_PATH = "E:\boost-1.47.0-mgw\build"
BDB_INCLUDE_PATH = "E:\deps\include"
BDB_LIB_PATH = "E:\deps\lib"
OPENSSL_INCLUDE_PATH = "E:\deps\include\openssl"
OPENSSL_LIB_PATH = "E:\deps\lib"
MINIUPNPC_INCLUDE_PATH = "E:\miniupnpc-1.6-mgw"
MINIUPNPC_LIB_PATH = "E:\miniupnpc-1.6-mgw"
BOOST_LIB_SUFFIX = "-mgw44-mt-s-1_47"
also edit the section where the libraries were specified to look like diapolo's post above. Also comment out the genbuild.sh section as he says.
Click the "projects" button
Turn off shadow build. Add the additional arguments USE_UPNP=- to qmake build steps and -f Makefile.Release to the make build steps.
Click "build" tab, and run QMake. Then build and run.
@mhredmond21 Well I don't need to add local paths like you do. Seems like some paths are missing in the %PATH% environment variable or I have the libs and headers in the right place. But I'm glad you got it working.
I didn't even think to try it like that. I was mainly focused on trying to replicate what worked for bitcoind build (makefile.mingw). I appreciate all your tips.
Everyone who is able to compile on Windows is of great help :). Are you planning to contribute via pulls / patches?
I plan to write patches but I am unsure if anybody will pull them. ;)
also -lwsock32 is missing
No it's not -lws2_32 or what compilation errors do you get?
also now I when I put USE_UPNP=-
qmake.exe C:\bitcoin-bitcoin-v0.6.1-621-g12e5881\bitcoin-bitcoin-12e5881\bitcoin-qt.pro -r -spec win32-g++ USE_UPNP=-
it does not work with me..
what is the exact format?
According to MS GetAcceptExSockaddrs() requires Mswsock, see http://msdn.microsoft.com/en-us/library/windows/desktop/ms738516%28v=vs.85%29.aspx.
Edit: Use "USE_UPNP=-" to disable UPNP support.
I got this error when I tried to run my bitcoin-qt.exe .. mingw10.dll is missing.. !! what to do? :((((
Seems your PATH environment variable does not include the path to MinGW. If you have MinGW installed in D:\MinGW, you need to include D:\MinGW\bin in PATH. That is because on Windows we get no statically linked bitcoin-qt binary and so it needs mingw10.dll and some other libs.
I added c:\MinGW\bin to the path and it does not work
Can you confirm that mingw10.dll is in C:\MinGW\bin? Btw. I only have mingwm10.dll (m added) in my bin folder, but perhaps you had a typo or that is because of my MinGW version. Is the error message the same (missing mingw10.dll)?
I had it in minwg\bin folder both that for qt creator (4.7) and the stand-alone one which I installed I dunno which version is it
Without more detailed information I'm unable to help any further beyond this, sorry.
I did this:
1. copied the bitcoin-qt.exe to the bin directory of mingw which is inside the Qtsdk (I used qt creator mingw to compile )
2. executed the bitcoin it gave me the following error: the procedure point _ZNK7QLocale17nativeCountryNameEv could not be located in the dynamic link library QtCored4.dll.
yes its typo mingwm10.dll :) .. but what to do now?
C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin I copied bitcoin there but then no output and no errors!!
Alright, I guess I know what the problem is.
Uninstall or remove the seperate MinGW installation, you have the Qt SDK installed, right? This has an compatible MinGW 4.4 integrated.
Now you have to add not only MinGW\bin to your PATH variable, but also %QTDIR%\lib and %QTDIR%\bin, where QTDIR is the path to the Qt installation (on my system this is D:\Qt_4.8.2).
The bitcoin-qt.exe depends on several libs that are in these 3 folders!
mingw version is 4.4
Come on ... try to read ... that IS what I said above. Current Qt SDK has MinGW 4.4...
OK I did this :
1. add to the path the following addresses
2. compiled again for 4.8 qt mingw4.4 as u said
but still the problem gives me error can not fin mingwm10.dll and when I copy the .exe file to C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin
I got silent application; that means no gui appears and no error messages .. nothing :(((
Ok, this is my last try!
C:\QtSDK\QtCreator\bin containsthe dll you mentioned, I had those paths added to my PATH variable:
and gor the same problem : missing mingwm10.dll.
and if I copied the file to C:\QtSDK\Desktop\Qt\4.8.0\mingw\bin
again silent execution . I checked the debug.log file its too old . I deleted the previous debug.log file .. and executed teh .exe no log file created. I really want help please its 10 days am trying to get bitcoin built on windows and now it not working .
I have my master thesis on some adaptation of bitcoin for other type of commidity trading. please help me what to do?
I AM sure that C:\QtSDK\QtCreator\bin is NOT correct, that is all I can say. Take another look if the mentioned files or paths are there twice and you chose the wrong one.
Please download and use https://qt.nokia.com/downloads/sdk-windows-cpp and perhaps try again with that.
I fixed the bitcoin was partialy launched (the logo only) then crashed.
Bitcoin version v0.6.99.0-g12e5881-beta ($Format:%cD)
Startup time: 07/27/12 21:27:25
Default data directory C:\Users\ealkawasmi\AppData\Roaming\Bitcoin
Used data directory C:\Users\ealkawasmi\AppData\Roaming\Bitcoin
Loading block index...
dbenv.open LogDir=C:\Users\ealkawasmi\AppData\Roaming\Bitcoin\database ErrorFile=C:\Users\ealkawasmi\AppData\Roaming\Bitcoin\db.log
DbEnv::open: DB_RUNRECOVERY: Fatal error, run database recovery
I put this in the PATH: C:\QtSDK\mingw\bin;C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin
I found the solution in this link in another issue: #809
I am soooooooooooooooo happy now I can sleep . The real work will start .
I have this issue today teh debug version of bitcoin works fine and every thing is ok.
BUT: the release version doesn't work and gives this error!!
The procedure entry point Z21qRegisterResourcesDataiPKhS0_S0 could not be locatedin dynamic link library QtCore4.dll.
what to do?
I still think you are using wrong paths in the PATH variable...
but the debug version works fine with me .. why the release not?
I re-installed QTSDK only version 4.8.1 to avoid version clashes and with Mingw 4.4 only for desktop development only
I searched my laptop and found many other qtcor4.dll but for other applications like nokia suit and mendely desktop and latex editor. and I had one in C:\QtSDK\QtCreator\bin and C:\QtSDK\QtCreator\lib and C:\QtSDK\Desktop\Qt\4.8.0\mingw\lib
which to put in my PATH variable?
I have currently not installed the QtSDK, but AFAIK it won't hurt to add all of them ... important is that the executable finds it's needed libs. Btw. did you specify "RELEASE=1" for qmake?
There's another thing that currently prevent the windows build in a 'bare' Qt SDK (current version - 1.2.1) from working: packaged mingw binutils don't support -Wl,--dynamicbase -Wl,--nxcompat
I really wish they would release a new Qt Sdk with mingw 4.6.x, that'd fix a lot of these issues and make it possible again for me to cross-build the dependencies.
You mean the Qt SDK integrated MinGW 4.4 does not support DEP / ASLR switches? I'm rather sure I was able to use them on Windows with the default SDK.
Btw. current Qt 4.8.3 seems to cause some problems on Windows too:
When I last tried, it was failing on some security-related switches. I'm not sure which ones, anymore.
Anyone still planning to update the windows build instructions? @Diapolo?
Yes! I plan to. Among other things, first, though, is getting the daemon bitcoind.exe to work correctly on windows! Then bitcoin-qt.exe. Then a windows .dsw, .sln or other VC++ Express freebie IDE build. I am a fan of VC++ 6.0 (how's that for old!) and VC++ Express 2005, which seems to have a links to the past and the future! Ron
No progress on this at all...?
Au contraire, see
especially, messages numbers 41, 85, 160, 176 (gcc) and 222, 228, 230 (MSVC++)
@old-c-coder I'm still hoping you supply some patches for us, sad you didn't yet participate here.
Hello Diapolo, rebroad...
See message # 550 at
and # 43 at
There are sources there that compile, link and run bitcoind 0.8.6, with OpenSSL 1.0.1g BTW!
Just the videos are missing on how to make the four libraries for bitcoin and any other *coin too, and these will be posted shortly.
Is anyone going to update the build instructions in doc/build-msw.md?
If not, I am going to remove them. They have been broken for a long time, and it's better to have no instruction than one that is so broken/outdated.
I can give doc/build-msw.md a "freshening". But really nitrogenetics message # 1 in
aka Building headless Bitcoin and Bitcoin-qt on Windows is the "prevailing wisdom". It is also an organic process, since bitcoin's linux build is changing too. On the other side of the coin, the build on Windows using MSVC++ is much cleaner! I can allude to that too in the build-msw.md, if you would like?
Personally I prefer self-contained build instructions in a document to a forum topic.
Anything in the repository is 'organic' as well, although it has to be kept up to date with master.
If you want to add MSVC build instructions as well that is great. It's less-well tested though. Does the resulting executable pass the unit tests?
I will try the unit tests on MSVC++.
After some trouble with the usual zero length vector<> references, I get:
Running 93 test cases...
src/test/netbase_tests.cpp(17): error in "netbase_networks": check CNetAddr("2001::8888").GetNetwork() == NET_IPV6 failed
src/test/netbase_tests.cpp(18): error in "netbase_networks": check CNetAddr("FD87:D87E:EB43:edb1:8e4:3588:e546:35ca").GetNetwork() == NET_TOR failed
src/test/netbase_tests.cpp(24): error in "netbase_properties": check CNetAddr("::FFFF:192.168.1.1").IsIPv4() failed
src/test/netbase_tests.cpp(29): error in "netbase_properties": check CNetAddr("2001:0DB8::").IsRFC3849() failed
src/test/netbase_tests.cpp(31): error in "netbase_properties": check CNetAddr("2002::1").IsRFC3964() failed
src/test/netbase_tests.cpp(32): error in "netbase_properties": check CNetAddr("FC00::").IsRFC4193() failed
src/test/netbase_tests.cpp(33): error in "netbase_properties": check CNetAddr("2001::2").IsRFC4380() failed
src/test/netbase_tests.cpp(34): error in "netbase_properties": check CNetAddr("2001:10::").IsRFC4843() failed
src/test/netbase_tests.cpp(35): error in "netbase_properties": check CNetAddr("FE80::").IsRFC4862() failed
src/test/netbase_tests.cpp(36): error in "netbase_properties": check CNetAddr("64:FF9B::").IsRFC6052() failed
src/test/netbase_tests.cpp(37): error in "netbase_properties": check CNetAddr("FD87:D87E:EB43:edb1:8e4:3588:e546:35ca").IsTor() failed
src/test/netbase_tests.cpp(39): error in "netbase_properties": check CNetAddr("::1").IsLocal() failed
src/test/netbase_tests.cpp(41): error in "netbase_properties": check CNetAddr("2001::1").IsRoutable() failed
src/test/netbase_tests.cpp(84): error in "netbase_lookupnumeric": check TestParse("::50:127.0.0.1", "127.0.0.1:80") failed
src/test/netbase_tests.cpp(84): error in "netbase_lookupnumeric": check TestParse("::ffff:127.0.0.1", "127.0.0.1:65535") failed
src/test/netbase_tests.cpp(85): error in "netbase_lookupnumeric": check TestParse("::", "[::]:65535") failed
src/test/netbase_tests.cpp(86): error in "netbase_lookupnumeric": check TestParse("[::]:8333", "[::]:8333") failed
src/test/netbase_tests.cpp(96): error in "onioncat_test": check addr1 == addr2 failed
*** 17 failures detected in test suite "Bitcoin Test Suite"
in about 11 seconds.
This is reasonable on my ipv4 static ip lan with no port forwarding and no upnp.
Yes I've seen the IPv6 tests fail before on Windows, that's not a big deal. UPnP and port forwarding should have no effect on the tests.
I removed the hopelessly outdated doc/build-msw.md.
Anyone building bitcoind/-qt on windows is welcome to contribute a new one.
I only see it in a mono-spaced font (in my IDE) so I don't know how to "markdown" it nicely,
but how about something like this?
Copyright (c) 2009-2013 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. This product includes
cryptographic software written by Eric Young (firstname.lastname@example.org), and UPnP software written by Thomas Bernard.
See readme-qt.rst for instructions on building Bitcoin-Qt, the
graphical user interface.
TODO: What works?
which is message #1 on the bitcointalk.org group
Building headless Bitcoin and Bitcoin-qt on Windows
There, the complete exposition of building Bitcoind and Bitcoin-Qt on Windows is given.
It is a dynamic process since the four libraries, the gcc compiler and the Bitcoin sources
are all "evolving".
gcc in a MinGW shell or a command box (dos window) on Windows.
Back in early 2013, the gcc version "du jour" was 4.6.2, though now it is 4.8.3, 4.9.1?
Note: releases are cross-compiled using mingw running on Linux.
As in the forum above, one can build in Windows, running a MinGW shell as needed.
One can also compile and run a MSVC++ version of Bitcoind.exe in MSVS any version,
personally my favorite.
Libraries you need to download separately and build:
default path download
OpenSSL \openssl-1.0.1h http://www.openssl.org/source/
Berkeley DB \db-4.8.30.NC http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost see versions at http://www.boost.org/users/history/
levelDB ...\src\leveldb https://code.google.com/p/leveldb/downloads/list
(optional)miniupnpc \miniupnpc-1.9 http://miniupnp.tuxfamily.org/files/
OpenSSL Old BSD license with the problematic advertising requirement
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license
miniupnpc New (3-clause) BSD license
Versions used in this release:
Berkeley DB 4.8.30.NC
miniupnpc 1.9 this is optional
The exposition below is better done in the forum mentioned above.
un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377)
change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe'
sh ../dist/configure --enable-mingw --enable-cxx
downloaded boost jam 3.1.18
bjam toolset=gcc --build-type=complete stage
UPnP support is optional, make with USE_UPNP= to disable it.
make -f Makefile.mingw
cp *.h miniupnpc/
mingw32-make -f makefile.mingw
build: Improve build instructions
- Add package instructions for Ubuntu 15.10
- Clarify BerkeleyDB/wallet situation for unix
- Add basic build instructions for Windows (closes #1401)