Bitcoin Forum
December 15, 2024, 02:04:41 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: After compiling Bitcoin 0.6.x for Windows with my custom MinGW-w64 build...  (Read 3424 times)
Wolf0 (OP)
Member
**
Offline Offline

Activity: 81
Merit: 1002


It was only the wind.


View Profile
July 22, 2013, 11:54:53 PM
 #1

... I am of the opinion that whoever designed the Windows compatibility should be shot, although I did finally get the daemon to compile. Is 0.8.x any better?
Diapolo
Hero Member
*****
Offline Offline

Activity: 772
Merit: 500



View Profile WWW
July 24, 2013, 07:14:13 AM
 #2

Can you please contribute via some pull-requests or at least open an issue ticket at Github (https://github.com/bitcoin/bitcoin/issues)?

Perhaps you can at least give some information why your points need fixing, as (at least) I'm currently not seeing any obious compiler errors or warnings when building with MinGW 4.8.1 and current master Smiley.

Thanks,
Dia

Liked my former work for Bitcoin Core? Drop me a donation via:
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
Diapolo
Hero Member
*****
Offline Offline

Activity: 772
Merit: 500



View Profile WWW
July 24, 2013, 07:23:30 AM
Last edit: July 24, 2013, 08:39:51 AM by Diapolo
 #3

#2: The type pid_t isn't defined because the includes for sys/types.h and sys/time.h are excluded for Windows. God knows why. Open util.h and move line 12 to a new line AFTER the include of sys/time.h. (sys/resource.h does not exist on Windows systems.)

pid_t is never used for Windows builds AFAIK, so it would be an idea to guard CreatePidFile() by #ifndef WIN32.

https://github.com/bitcoin/bitcoin/pull/2855

Dia

Liked my former work for Bitcoin Core? Drop me a donation via:
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
Diapolo
Hero Member
*****
Offline Offline

Activity: 772
Merit: 500



View Profile WWW
July 24, 2013, 08:40:54 AM
 #4

Can you please contribute via some pull-requests or at least open an issue ticket at Github (https://github.com/bitcoin/bitcoin/issues)?

Perhaps you can at least give some information why your points need fixing, as (at least) I'm currently not seeing any obious compiler errors or warnings when building with MinGW 4.8.1 and current master Smiley.

Thanks,
Dia

Are you using MinGW-w64, or the old MinGW that doesn't support 64 bit?

I'm using Mingwbuilds (http://sourceforge.net/projects/mingwbuilds/) and from this a x86 version of MinGW 4.8.1.

Dia

Liked my former work for Bitcoin Core? Drop me a donation via:
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
Diapolo
Hero Member
*****
Offline Offline

Activity: 772
Merit: 500



View Profile WWW
July 24, 2013, 09:48:21 AM
 #5

Strange, you should at least run into problems #1, #2, and #3.

#1 It makes no difference, I removed the typedef u_int to SOCKET and compiled, which generates no error or warning just like before. Anyway, if this is not needed we should perhaps also just remove it from the code. What compiler error do you get from this, can you post it?

#2 My pull also prevents this from beeing a problem without new includes for WIN32. As we often use #ifdef WIN32, is this correct with mingw-64 or a 64 bit compiler also or could that cause your errors? Same question as above, can you post compiler errors / warnings for this?

#3 No idea for this, can you link me to a page that gives info about when to define or set BOOST_USE_WINDOWS_H.

One last thing, I compile bitcoin-qt, not bitcoind, perhaps that also makes a difference...

Thanks,
Dia

Liked my former work for Bitcoin Core? Drop me a donation via:
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
July 24, 2013, 11:02:55 AM
 #6

MinGW-W64 != MinGW32. Both projects are maintained by different people afaik. I've had some weird errors with mingw64 than with regular x86 mingw on many non-bitcoin related projects.

Plus, 0.6.2 should be obsolete.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
Diapolo
Hero Member
*****
Offline Offline

Activity: 772
Merit: 500



View Profile WWW
July 24, 2013, 12:45:48 PM
 #7

I get the following:

Code:
g++ -c -mthreads -O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-par
ameter -g -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -D
USE_IPV6=1 -I/cygdrive/c/deps/bitcoin/src/leveldb/include -I/cygdrive/c/deps/bit
coin/src/leveldb/helpers -I"/cygdrive/c/deps/bitcoin/src"  -I"C:/deps/boost_1_54
_0"  -I"C:/deps/db-4.8.30.NC/build_unix"  -I"C:/deps/win64-openssl/include" -o o
bj/alert.o alert.cpp
In file included from netbase.h:11:0,
                 from util.h:30,
                 from alert.h:13,
                 from alert.cpp:11:
compat.h:29:15: error: conflicting declaration 'typedef u_int SOCKET'
 typedef u_int SOCKET;
               ^
In file included from c:\mingw\x86_64-w64-mingw32\include\winsock2.h:55:0,
                 from compat.h:15,
                 from netbase.h:11,
                 from util.h:30,
                 from alert.h:13,
                 from alert.cpp:11:
c:\mingw\x86_64-w64-mingw32\include\psdk_inc\_socket_types.h:11:18: error: 'SOCK
ET' has a previous declaration as 'typedef UINT_PTR SOCKET'
 typedef UINT_PTR SOCKET;
                  ^
In file included from alert.h:13:0,
                 from alert.cpp:11:
util.h:211:57: error: 'pid_t' has not been declared
 void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
                                                         ^
makefile.mingw:127: recipe for target `obj/alert.o' failed
make: *** [obj/alert.o] Error 1

About #3, I think we're running into this bug: https://svn.boost.org/trac/boost/ticket/4849

The CreatePidFile() error will be gone with my pull included in master. I'll also create a pull to remove the typedef u_int SOCKET; from compat.h.
For the Boost bug you mention, it seems that was fixed long ago in 1.47.0 and we are currently using 1.50 for our Windows builds (my own build is using 1.54).
Which Boost version are you using?

Dia

Liked my former work for Bitcoin Core? Drop me a donation via:
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
Diapolo
Hero Member
*****
Offline Offline

Activity: 772
Merit: 500



View Profile WWW
July 24, 2013, 01:00:14 PM
Last edit: July 24, 2013, 01:23:27 PM by Diapolo
 #8

I get the following:

Code:
g++ -c -mthreads -O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-par
ameter -g -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -D
USE_IPV6=1 -I/cygdrive/c/deps/bitcoin/src/leveldb/include -I/cygdrive/c/deps/bit
coin/src/leveldb/helpers -I"/cygdrive/c/deps/bitcoin/src"  -I"C:/deps/boost_1_54
_0"  -I"C:/deps/db-4.8.30.NC/build_unix"  -I"C:/deps/win64-openssl/include" -o o
bj/alert.o alert.cpp
In file included from netbase.h:11:0,
                 from util.h:30,
                 from alert.h:13,
                 from alert.cpp:11:
compat.h:29:15: error: conflicting declaration 'typedef u_int SOCKET'
 typedef u_int SOCKET;
               ^
In file included from c:\mingw\x86_64-w64-mingw32\include\winsock2.h:55:0,
                 from compat.h:15,
                 from netbase.h:11,
                 from util.h:30,
                 from alert.h:13,
                 from alert.cpp:11:
c:\mingw\x86_64-w64-mingw32\include\psdk_inc\_socket_types.h:11:18: error: 'SOCK
ET' has a previous declaration as 'typedef UINT_PTR SOCKET'
 typedef UINT_PTR SOCKET;
                  ^
In file included from alert.h:13:0,
                 from alert.cpp:11:
util.h:211:57: error: 'pid_t' has not been declared
 void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
                                                         ^
makefile.mingw:127: recipe for target `obj/alert.o' failed
make: *** [obj/alert.o] Error 1

About #3, I think we're running into this bug: https://svn.boost.org/trac/boost/ticket/4849

The CreatePidFile() error will be gone with my pull included in master. I'll also create a pull to remove the typedef u_int SOCKET; from compat.h.
For the Boost bug you mention, it seems that was fixed long ago in 1.47.0 and we are currently using 1.50 for our Windows builds (my own build is using 1.54).
Which Boost version are you using?

Dia

My build is also using 1.54. Apparently it wasn't fixed.

As I said, I never saw that Boost error and it seems neither does our Gitian build suffer from this or our pulltester.
Can you post the boost related compiler errors/warnings also?

Dia

Liked my former work for Bitcoin Core? Drop me a donation via:
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
cabin
Sr. Member
****
Offline Offline

Activity: 604
Merit: 250


View Profile
August 28, 2013, 02:19:13 AM
Last edit: August 28, 2013, 12:08:50 PM by cabin
 #9

I get these boost errors on mingw64 as well:

c:/data/miner2/deps/boost_1_54_0/boost/detail/interlocked.hpp:161:37: error: '_I
nterlockedExchange' is not a member of 'boost::detail'
 # define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange

Wolf can you explain what and where the BOOST_USE_WINDOWS_H fix goes?

Edit: Got it.. using lines like these in makefile.mingw fixed it:

DEFS=-DWIN32_LEAN_AND_MEAN -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DBOOST_USE_WINDOWS_H

LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -static

Diapolo
Hero Member
*****
Offline Offline

Activity: 772
Merit: 500



View Profile WWW
August 30, 2013, 11:16:23 PM
 #10

I get these boost errors on mingw64 as well:

c:/data/miner2/deps/boost_1_54_0/boost/detail/interlocked.hpp:161:37: error: '_I
nterlockedExchange' is not a member of 'boost::detail'
 # define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange

Wolf can you explain what and where the BOOST_USE_WINDOWS_H fix goes?

Edit: Got it.. using lines like these in makefile.mingw fixed it:

DEFS=-DWIN32_LEAN_AND_MEAN -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DBOOST_USE_WINDOWS_H

LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -static



Yeah, it goes in DEFS. I'm hoping the devs will put it in there so people don't have to fix it.

If you want to help us out go ahead and create a pull-request on https://github.com/bitcoin/bitcoin/pulls Smiley.

Dia

Liked my former work for Bitcoin Core? Drop me a donation via:
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!