Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: piotr_n on September 24, 2011, 01:33:54 PM



Title: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: piotr_n on September 24, 2011, 01:33:54 PM
According to build-msw.txt all one needs to do is:
Quote
MSYS shell:
cd /c/db-4.8.30.NC-mgw/build_unix
sh ../dist/configure --enable-mingw --enable-cxx
make

It worked just perfect with the previous version (4.7.25).
But with 4.8.30 it just crashesh like this:
Quote
$ make
./libtool --mode=compile gcc -c -I. -I../dist/..  -O3  ../dist/../mutex/mut_win32.c
libtool: compile:  gcc -c -I. -I../dist/.. -O3 ../dist/../mutex/mut_win32.c  -DDLL_EXPORT -DPIC -o .libs/mut_win32.o
In file included from ./db_int.h:886:0,
                 from ../dist/../mutex/mut_win32.c:12:
../dist/../dbinc/repmgr.h:502:13: error: two or more data types in declaration specifiers
../dist/../dbinc/repmgr.h:502:1: warning: useless type name in empty declaration
make: *** [mut_win32.lo] Error 1

So how do you build it?


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: piotr_n on October 03, 2011, 06:25:05 PM
Should I consider the lack of any answer more like 'works for me', 'we never compile windows client' or rather 'who the hell are you to ask me such questions?' :)


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: piotr_n on October 06, 2011, 10:28:26 AM
I got it via PM:
Busted out of the newbie area to get you this.
I was able to compile db-4.8.30.NC by doing the following.

../dist/configure --disable-replication --enable-mingw --enable-cxx --prefix=/usr/local

db.h in build_unix/
@ Line 113 Replace

typedef pthread_t db_threadid_t;

with

typedef u_int32_t db_threadid_t;

Then did make. Hope it works for you!

It worked for me -  thanks Icy!


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Diapolo on July 07, 2012, 11:58:34 PM
If this works you are my hero :), as I have the same error when doing:

../dist/configure --enable-mingw --enable-cxx

I try to compile on Windows 7 with MinGW (GCC 4.7).

Dia


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Diapolo on July 08, 2012, 10:49:04 AM
Holy fuck and shit, after fixing another small glitch (will report back later for investigation), it works.
I compiled my own BDB lib, compiled Bitcoin-Qt and it starts and works ... great stuff.

Dia


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Diapolo on July 08, 2012, 12:00:20 PM
I've got a question, in the 4.7 db.h line 113 reads:
typedef uintmax_t db_threadid_t;

In 4.8 they changed it to:
typedef pthread_t db_threadid_t;

While your version (which fixes the compilation errors with MinGW) is:
typedef u_int32_t db_threadid_t;

How large can thread IDs be? I'm just asking, if u_int32_t is sufficient here?

Dia


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Pieter Wuille on July 08, 2012, 12:37:31 PM
See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683183(v=vs.85).aspx

Thread IDs are DWORDs on Windows, meaning 32 bits.


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Diapolo on July 08, 2012, 02:27:49 PM
See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683183(v=vs.85).aspx

Thread IDs are DWORDs on Windows, meaning 32 bits.

Thank you!

Dia


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Onichan on July 11, 2012, 01:02:51 AM
If you are trying to compile the client using windows then you might have some trouble. I know the last time I tried which was a while ago it had many problems. I write a quick guide on how to do it using a virtual and Ubuntu https://bitcointalk.org/index.php?topic=84984


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Diapolo on July 11, 2012, 04:59:18 AM
If you are trying to compile the client using windows then you might have some trouble. I know the last time I tried which was a while ago it had many problems. I write a quick guide on how to do it using a virtual and Ubuntu https://bitcointalk.org/index.php?topic=84984

It's compiling just fine on Windows 7 :). Need to build BDB, OpenSSL and Boost libs, which I now figured out how to do it.

Dia


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: mightycount on December 04, 2012, 10:48:37 PM
I got it via PM:
Busted out of the newbie area to get you this.
I was able to compile db-4.8.30.NC by doing the following.

../dist/configure --disable-replication --enable-mingw --enable-cxx --prefix=/usr/local

db.h in build_unix/
@ Line 113 Replace

typedef pthread_t db_threadid_t;

with

typedef u_int32_t db_threadid_t;

Then did make. Hope it works for you!

It worked for me -  thanks Icy!

+1


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: gremlinsinc on January 26, 2014, 03:26:14 AM
Having same problem... building a clone from Dogecoin source.Having this same issue, I think this solved it.. Now if I can get boost to build right, I might have this thing knocked together tonight.


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: hadi on March 18, 2014, 07:25:34 PM
I have similiar issue.i replaced typedef u_int32_t db_threadid_t; but not work

can any1 help me ?

http://www.shiaupload.ir/images/20011865285765421726.jpg


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: c275 on November 04, 2015, 06:40:39 PM
I have similiar issue.i replaced typedef u_int32_t db_threadid_t; but not work

can any1 help me ?

http://www.shiaupload.ir/images/20011865285765421726.jpg

Same problem here. changing db.h dosen't work. Any help? :(


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Polyatomic on November 08, 2015, 09:21:01 PM
Dude, careful observers here may need more
say build env version, a full build log with the
crapout including the commands used verbatim.
Prolly use a paste site service and prolly not
pastebin.com, it's veritable crud.


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: YarkoL on November 13, 2015, 06:15:48 PM

@c275

Try reconfiguring with

../dist/configure --enable-cxx --enable-mingw --disable-pthread_api --disable-replication

Then make again.


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: Bitcoin_Delivery on February 18, 2016, 07:42:11 PM
I got it via PM:
Busted out of the newbie area to get you this.
I was able to compile db-4.8.30.NC by doing the following.

../dist/configure --disable-replication --enable-mingw --enable-cxx --prefix=/usr/local

db.h in build_unix/
@ Line 113 Replace

typedef pthread_t db_threadid_t;

with

typedef u_int32_t db_threadid_t;

Then did make. Hope it works for you!

It worked for me -  thanks Icy!

I want to confirm that this worked for me too....i was going out of head without finding a solution and thats was pure gold!
Thanks

PS: compile on win is a shite! Long life to *nix


Title: Re: How do you build Berkeley DB 4.8.30 in MinGW?
Post by: tracercho on June 06, 2016, 10:22:18 PM
Hello ,

I replaced  ypedef pthread_t db_threadid_t; with typedef u_int32_t db_threadid_t; in db.h. It didn't work, then i tried reconfiguring with ../dist/configure --enable-cxx --enable-mingw --disable-pthread_api --disable-replication and still the same error.

https://i.imgur.com/Qi7HcDC.png