Pages:
Author

Topic: [COLLECTED] 100 BTC Bounty For Windows Build Instructions - page 2. (Read 18229 times)

sr. member
Activity: 371
Merit: 250
Put it in more places? Smiley

In the file trying to include buffer,h, change the include to have teh exact path to buffer.h? :?
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
My notes from TRYING to do this:

 - If you have never used command-line compile tools before, prepare to be baffled and befuddled. This is not a nice clean GUI where you hit the compile button, wait a few seconds, and go try your executable. Thankfully, I've used gcc before, so I wasn't completely out of my element
 - Expect the whole process from learning to downloading to compiling to troubleshooting, to take HOURS. I'm not kidding. These makefiles build THOUSANDS of object files, of which bitcoin probably uses a tiny percentage. Boost is the worst of them all. Just start the make and let it run overnight.
 - Before running the steps outlined in the earlier post, I recommend you get yourself a github account, and follow their instructions to download and install "git" and set up your own sandbox (fork) of the bitcoin source. This will involve yet even more baffling command lines that need to be copied and run exactly as written on the github guide to getting started
 - Do not watch the scroll of status messages going by during the eternity it takes to compile everything. You will see countless frightening-sounding warnings which will only confuse you
 - Do not expect a nice little "all done, everything went ok!" message at the end of a long compilation. The nice ones just stop printing status messages, and you are supposed to know from the acres of text above that nothing bad happened. The others are less nice . . .
 - Boost finally finished compiling with this very comforting message:
Quote
...failed updating 8 targets...
...skipped 8 targets...
...updated 4393 targets...
Great.
 - At the end of the make for openssl, the linker returned a very fatal-sounding
Quote
undefined reference to `WinMain@16'
I wasted some time trying to "make clean" and try "make" again, but eventually I went on to the next step, and I still got the expected libeay32.dll without any complaints.
 - Finally, I tried compiling bitcoin (ha!) - as you might expect, it wasn't happy. The error message was:
Quote
In file included from util.cpp:5:0:
headers.h:38:28: fatal error: openssl/buffer.h: No such file or directory
I found buffer.h in the includes directory for openssl, so I copied that directory out and renamed it "openssl" which I then put everywhere I could think of. No luck.

Linux compile tools let you stand on the shoulders of giants, but the giants all have Asperger's.

Any help would be appreciated.
member
Activity: 70
Merit: 18
Great guide!  TY!

The makefile now appears to look for C:\openssl-1.0.0d-mgw instead of C:\openssl-1.0.0c-mgw and it was failing on that.  But just a minor speed bump.

Again, thanks!
legendary
Activity: 2058
Merit: 1452
great guide! thank you very much
hero member
Activity: 755
Merit: 515
@Unfinishe: Just sent you a coin using my new binary, plus an extra 1 for matt Cheesy
Thank you good sir.
full member
Activity: 126
Merit: 100
Awesome, that worked thanks Cheesy

@Unfinishe: Just sent you a coin using my new binary, plus an extra 1 for matt Cheesy


Thank you so much!  Smiley
full member
Activity: 154
Merit: 100
Awesome, that worked thanks Cheesy

@Unfinishe: Just sent you a coin using my new binary, plus an extra 1 for matt Cheesy
full member
Activity: 154
Merit: 100
I went through all the steps and finally when I did make -f makefile.mingw I got this:

Code:
In file included from util.cpp:5:0:
headers.h:62:29: fatal error: boost/foreach.hpp: No such file or directory
compilation terminated.
make: *** [obj/util.o] Error 1

I tried copying the boost folder to the bitcoin src directory but got the same error... I don't know where I need to move it to in order for it to be found.

The makefile is looking for the boost folder at C:\boost-1.43.0-mgw . It's possible that there is a typo or something.

Wow you're right thanks, I didn't notice that until you mentioned it. I just extracted and added -mgw to the dir name without realising it's called boost_1_43_0-mgw.
full member
Activity: 126
Merit: 100
I went through all the steps and finally when I did make -f makefile.mingw I got this:

Code:
In file included from util.cpp:5:0:
headers.h:62:29: fatal error: boost/foreach.hpp: No such file or directory
compilation terminated.
make: *** [obj/util.o] Error 1

I tried copying the boost folder to the bitcoin src directory but got the same error... I don't know where I need to move it to in order for it to be found.

The makefile is looking for the boost folder at C:\boost-1.43.0-mgw . It's possible that there is a typo or something.
full member
Activity: 154
Merit: 100
I went through all the steps and finally when I did make -f makefile.mingw I got this:

Code:
In file included from util.cpp:5:0:
headers.h:62:29: fatal error: boost/foreach.hpp: No such file or directory
compilation terminated.
make: *** [obj/util.o] Error 1

I tried copying the boost folder to the bitcoin src directory but got the same error... I don't know where I need to move it to in order for it to be found.
sr. member
Activity: 322
Merit: 251
Just to let you know, I had to modify makefile.mingw and change the following lines:

Code:
LIBS= \
 -l boost_system-mgw45-mt-s-1_43 \
 -l boost_filesystem-mgw45-mt-s-1_43 \
 -l boost_program_options-mgw45-mt-s-1_43 \
 -l boost_thread-mgw45-mt-s-1_43 \
 -l db_cxx \
 -l eay32

To:

Code:
LIBS= \
 -l boost_system-mgw44-mt-s-1_43 \
 -l boost_filesystem-mgw44-mt-s-1_43 \
 -l boost_program_options-mgw44-mt-s-1_43 \
 -l boost_thread-mgw44-mt-s-1_43 \
 -l db_cxx \
 -l eay32

Also, like Gallop I had to recompile Berkley DB.

Thank you for the wonderful guide, BlueMatt.

~lulzplzkthx
newbie
Activity: 3
Merit: 0
You should strip bitcoin.exe.  That should help.

Gotcha. A more manageable 7.5MB now. Cheers!
hero member
Activity: 755
Merit: 515
90MB .exe but it seems to work fine.
You should strip bitcoin.exe.  That should help.
newbie
Activity: 3
Merit: 0
Don't know, never seen it.  Make sure you have a libdb_cxx.a in C:\db-4.7.25.NC-mgw\build_unix. 

There was no libdb_cxx.a indeed. I recompiled C:\db-4.7.25.NC-mgw\ and the file was there now. Not sure what happened. Anyway, the good news is that it compiled successfully! Thanks.

90MB .exe but it seems to work fine.
hero member
Activity: 755
Merit: 515
Code:
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -ldb_cxx
Don't know, never seen it.  Make sure you have a libdb_cxx.a in C:\db-4.7.25.NC-mgw\build_unix. 
newbie
Activity: 3
Merit: 0
Nice work.

So I followed the steps on an XP machine and during the final compilation of Bitcoin, I get this error message:

Code:
g++ -mthreads -O2 -w -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DSTATICLIB
-DUSE_UPNP=0 -I"C:\boost-1.43.0-mgw" -I"C:\db-4.7.25.NC-mgw\build_unix" -I"C:\openssl-1.0.0c-mgw\include" -I"C:\wxWidget
s-2.9.1-mgw\lib\gcc_lib\mswud" -I"C:\wxWidgets-2.9.1-mgw\include" -I"C:\upnpc-exe-win32-20110215" -mwindows -Wl,--subsys
tem,windows -o bitcoin.exe -L"C:\boost-1.43.0-mgw\stage\lib" -L"C:\db-4.7.25.NC-mgw\build_unix" -L"C:\openssl-1.0.0c-mgw
" -L"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib" -L"C:\upnpc-exe-win32-20110215" obj/util.o obj/script.o obj/db.o obj/net.o obj/
irc.o obj/main.o obj/rpc.o obj/init.o cryptopp/obj/sha.o cryptopp/obj/cpu.o obj/ui.o obj/uibase.o obj/ui_res.o -l wxmsw2
9ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd -l boost_system-mgw
45-mt-s-1_43 -l boost_filesystem-mgw45-mt-s-1_43 -l boost_program_options-mgw45-mt-s-1_43 -l boost_thread-mgw45-mt-s-1_4
3 -l db_cxx -l eay32 -l miniupnpc -l iphlpapi -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32
 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -ldb_cxx
collect2: ld returned 1 exit status
make: *** [bitcoin.exe] Error 1

Probably something fishy with Berkeley DB, but I'm not clear how to fix this. Thanks for any help.


member
Activity: 69
Merit: 10
@BlueMatt Thank you very much for the instructions, I'm following them to build Namecoin.  Just a note, I'm building on Windows 7 64bit and I had to add the "address-module=32" parameters to the boost build in order for it to compile without error.

Code:
\bjam\bjam.exe toolset=gcc address-model=32 --build-type=complete stage
sr. member
Activity: 504
Merit: 252
Elder Crypto God
hero member
Activity: 755
Merit: 515
Kind of sad that 100 BTC has to be offered for this, someone really needs to rewrite the build process.  Oh well, here goes:

Install:

Download:

Note that the reason for using the binary miniupnpc release is that I was unable to get it to build on my system.

Add C:\MinGW\bin to your PATH environment variable (Google is your friend as it depends on your Windows Version).
In the DOS Shell:
wxWidgets:
Code:
cd \wxWidgets-2.9.1-mgw\build\msw
mingw32-make -f makefile.gcc

Boost:
Code:
cd \boost-1.43.0-mgw
\bjam\bjam.exe toolset=gcc --build-type=complete stage

In the msys Shell (MinGW shell in your start folder or C:\MinGW\msys\1.0\msys.bat):
OpenSSL:
Code:
cd /c/openssl-1.0.0c-mgw
./config
make
perl util/mkdef.pl 32 libeay enable-static-engine > libeay32.def
dllwrap --dllname libeay32.dll --output-lib libeay32.a --def libeay32.def libcrypto.a -lws2_32 -lgdi32
Copy the libeay32.dll file to the folder where you are building/running bitcoin.

Berkeley DB:
Code:
cd /c/db-4.7.25.NC-mgw/build_unix
sh ../dist/configure --enable-mingw --enable-cxx
make

Bitcoin
If you wish to use git to pull keep a local repository, you'll have to download msgit from http://code.google.com/p/msysgit/downloads/detail?name=Git-1.7.4-preview20110204.exe&can=2&q=.
Otherwise, you can download the latest zip of bitcoin from https://github.com/bitcoin/bitcoin/zipball/master
In the msys shell, cd to the unzipped location and
Code:
make -f makefile.mingw
Run with ./bitcoin.exe (make sure you have the libeay32.dll in bitcoin folder)
newbie
Activity: 32
Merit: 0
you can also build the binary using mingw if you're more familar with linux
Pages:
Jump to: