Pages:
Author

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

full member
Activity: 131
Merit: 108
If I try to copy content of winsock2.h and replace ws2tcpip.h, i will get an error at netbase.cpp where it need ws2tcpip.h , so I can't really fix this part

#error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

what should i do..

You are most likely using the wrong toolchain. You should use one of the latest mingw-builds toolchains.



I took me at least two 40 hour weeks to get my first coin to build under windows.  It took 5 minutes under Linux.  Once you get the environment setup right, it will go easier.

the windows wallet can't be built under linux though right?

In theory you could cross-compile, spent a week trying, on and off, and never got there.  Always one piece that wouldn't fit in the puzzle.

Windows executables can be cross-compiled on gitian. See http://gavintech.blogspot.it/2014/02/gitian-building-bitcoin-releases.html



Been trying to build for months off and on... Followed the instructions to the letter and on any build, I always get the same exact error message when I try to run the otherwise cleanly compiled executable:

What am I doing wrong here?

Windows 7 x64 build environment which is freshly installed in a VM.


Not crashing here. Make sure your build environment and project file are ok.

full member
Activity: 138
Merit: 100
Been trying to build for months off and on... Followed the instructions to the letter and on any build, I always get the same exact error message when I try to run the otherwise cleanly compiled executable:



What am I doing wrong here?

Windows 7 x64 build environment which is freshly installed in a VM.
sr. member
Activity: 470
Merit: 250
Better to have 100 friends than 100 rubles
I took me at least two 40 hour weeks to get my first coin to build under windows.  It took 5 minutes under Linux.  Once you get the environment setup right, it will go easier.

the windows wallet can't be built under linux though right?

In theory you could cross-compile, spent a week trying, on and off, and never got there.  Always one piece that wouldn't fit in the puzzle.
member
Activity: 84
Merit: 10
I took me at least two 40 hour weeks to get my first coin to build under windows.  It took 5 minutes under Linux.  Once you get the environment setup right, it will go easier.

the windows wallet can't be built under linux though right?
newbie
Activity: 5
Merit: 0
I took me at least two 40 hour weeks to get my first coin to build under windows.  It took 5 minutes under Linux.  Once you get the environment setup right, it will go easier.
Same here, linux on minutes
sr. member
Activity: 470
Merit: 250
Better to have 100 friends than 100 rubles
I took me at least two 40 hour weeks to get my first coin to build under windows.  It took 5 minutes under Linux.  Once you get the environment setup right, it will go easier.
member
Activity: 84
Merit: 10
Was there something above that?  Those all look like warnings... not errors that would halt the compile.

there is an error at the bottom that halted the compile and the cmd buffer isn't going back far enough to see this has been a total head ache lol
sr. member
Activity: 470
Merit: 250
Better to have 100 friends than 100 rubles
Was there something above that?  Those all look like warnings... not errors that would halt the compile.
member
Activity: 84
Merit: 10
Fortunately your near the end of the path... (pun intended).  [You need to add QT/bin to the end of your PATH variable]

If you prefer, just do the qmake from a windows command prompt or whatever environment you had it running it before.  The key is to build the libleveldb and libmemenv first as shown in the example.

lol I wish it was that simple but qt has already been added to my path plus this is the errors that I am getting now

Code:
e_exchange(T*, T, T) [with T = boost::shared_mutex::state_data]':
..\deps\boost_1_55_0/boost/thread/win32/shared_mutex.hpp:124:103:   required from here
..\deps\boost_1_55_0/boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break st
rict-aliasing rules [-Wstrict-aliasing]
                                                               *reinterpret_cast(&comparand));
                                                                                                   ^
..\deps\boost_1_55_0/boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break st
rict-aliasing rules [-Wstrict-aliasing]
..\deps\boost_1_55_0/boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break st
rict-aliasing rules [-Wstrict-aliasing]
             return *reinterpret_cast(&res);
                                                    ^
..\deps\boost_1_55_0/boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break st
rict-aliasing rules [-Wstrict-aliasing]
In file included from ..\deps\boost_1_55_0/boost/system/system_error.hpp:14:0,
                 from ..\deps\boost_1_55_0/boost/thread/exceptions.hpp:22,
                 from ..\deps\boost_1_55_0/boost/thread/win32/thread_primitives.hpp:16,
                 from ..\deps\boost_1_55_0/boost/thread/win32/basic_timed_mutex.hpp:14,
                 from ..\deps\boost_1_55_0/boost/thread/win32/mutex.hpp:9,
                 from ..\deps\boost_1_55_0/boost/thread/mutex.hpp:14,
                 from src/allocators.h:10,
                 from src\qt\walletmodel.h:8,
                 from src\qt\bitcoin.cpp:9:
..\deps\boost_1_55_0/boost/system/error_code.hpp: At global scope:
..\deps\boost_1_55_0/boost/system/error_code.hpp:222:36: warning: 'boost::system::posix_category' defined but not used [
-Wunused-variable]
     static const error_category &  posix_category = generic_category();
                                    ^
..\deps\boost_1_55_0/boost/system/error_code.hpp:223:36: warning: 'boost::system::errno_ecat' defined but not used [-Wun
used-variable]
     static const error_category &  errno_ecat     = generic_category();
                                    ^
..\deps\boost_1_55_0/boost/system/error_code.hpp:224:36: warning: 'boost::system::native_ecat' defined but not used [-Wu
nused-variable]
     static const error_category &  native_ecat    = system_category();
                                    ^
Makefile.Release:811: recipe for target 'build/bitcoin.o' failed
mingw32-make: *** [build/bitcoin.o] Error 1

C:\JennyCoin>
sr. member
Activity: 470
Merit: 250
Better to have 100 friends than 100 rubles
Ok I have figured all the other errors out and now I am just getting the following, anyone able to help with this, be appreciated

Code:
C:\JennyCoin>mingw32-make -f Makefile.Release
mingw32-make: *** No rule to make target 'c:/JennyCoin/src/leveldb/libleveldb.a', needed by 'release\JennyCoin-qt.exe'.
 Stop.

C:\JennyCoin>

Open a MinGW window and:

cd /JennyCoin/src/leveldb
TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a

Then...

cd ../..
qmake JennyCoin-qt.pro
mingw32-make -f Makefile.Release

qmake doesn't work inside of mingw seems like every step I get further in I run into another problem

Fortunately your near the end of the path... (pun intended).  [You need to add QT/bin to the end of your PATH variable]

If you prefer, just do the qmake from a windows command prompt or whatever environment you had it running it before.  The key is to build the libleveldb and libmemenv first as shown in the example.
member
Activity: 84
Merit: 10
Ok I have figured all the other errors out and now I am just getting the following, anyone able to help with this, be appreciated

Code:
C:\JennyCoin>mingw32-make -f Makefile.Release
mingw32-make: *** No rule to make target 'c:/JennyCoin/src/leveldb/libleveldb.a', needed by 'release\JennyCoin-qt.exe'.
 Stop.

C:\JennyCoin>

Open a MinGW window and:

cd /JennyCoin/src/leveldb
TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a

Then...

cd ../..
qmake JennyCoin-qt.pro
mingw32-make -f Makefile.Release

qmake doesn't work inside of mingw seems like every step I get further in I run into another problem
sr. member
Activity: 470
Merit: 250
Better to have 100 friends than 100 rubles
Ok I have figured all the other errors out and now I am just getting the following, anyone able to help with this, be appreciated

Code:
C:\JennyCoin>mingw32-make -f Makefile.Release
mingw32-make: *** No rule to make target 'c:/JennyCoin/src/leveldb/libleveldb.a', needed by 'release\JennyCoin-qt.exe'.
 Stop.

C:\JennyCoin>

Open a MinGW window and:

cd /JennyCoin/src/leveldb
TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a

Then...

cd ../..
qmake JennyCoin-qt.pro
mingw32-make -f Makefile.Release
member
Activity: 84
Merit: 10
Ok I have figured all the other errors out and now I am just getting the following, anyone able to help with this, be appreciated

Code:
C:\JennyCoin>mingw32-make -f Makefile.Release
mingw32-make: *** No rule to make target 'c:/JennyCoin/src/leveldb/libleveldb.a', needed by 'release\JennyCoin-qt.exe'.
 Stop.

C:\JennyCoin>
newbie
Activity: 17
Merit: 0
Code:
g++ -c -pipe -D_FORTIFY_SOURCE=2 -O2 -frtti -fexceptions -mthreads -fdiagnostics
-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wst
ack-protector -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Lc
:\MinGW\bin\libexec\gcc\mingw32\4.8.1 -DUNICODE -DQT_GUI -DBOOST_THREAD_USE_LIB
-DBOOST_SPIRIT_THREADSAFE -DUSE_UPNP=1 -DSTATICLIB -DWIN32 -D_MT -DQT_THREAD_SUP
PORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQ
T_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_NEEDS_QMAIN -I".
.\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\Qt\4.8.5\include\QtNetwork" -I"..\.
.\..\Qt\4.8.5\include\QtGui" -I"..\..\..\Qt\4.8.5\include" -I"src" -I"src\json"
-I"src\qt" -I"..\..\..\deps" -I"src\leveldb\include" -I"src\leveldb\helpers" -I"
..\..\boost_1_55_0" -I"..\..\db-4.8.30.NC\build_unix" -I"..\..\openssl-1.0.1e\in
clude" -I"..\..\..\Qt\4.8.5\include\ActiveQt" -I"build" -I"build" -I"..\..\..\Qt
\4.8.5\mkspecs\win32-g++" -o build\rpcnet.o src\rpcnet.cpp
In file included from src\netbase.h:11:0,
                 from src\net.h:19,
                 from src\rpcnet.cpp:6:
src\compat.h:14:0: warning: "FD_SETSIZE" redefined [enabled by default]
 #define FD_SETSIZE 1024 // max number of fds in fd_set
 ^
In file included from c:\mingw\include\windows.h:93:0,
                 from ..\..\openssl-1.0.1e\include/openssl/rand.h:67,
                 from src\net.h:11,
                 from src\rpcnet.cpp:6:
c:\mingw\include\winsock.h:62:0: note: this is the location of the previous defi
nition
 #define FD_SETSIZE 64
 ^
In file included from src\compat.h:17:0,
                 from src\netbase.h:11,
                 from src\net.h:19,
                 from src\rpcnet.cpp:6:
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 src\schnorr.h:11:0,
                 from src\hash.h:17,
                 from src\net.h:22,
                 from src\rpcnet.cpp:6:
src\cryptopp/osrng.h:43:0: warning: ignoring #pragma comment  [-Wunknown-pragmas
]
 #pragma comment(lib, "advapi32.lib")
 ^
In file included from src\compat.h:17:0,
                 from src\netbase.h:11,
                 from src\net.h:19,
                 from src\rpcnet.cpp:6:
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 ..\..\openssl-1.0.1e\include/openssl/rand.h:67,
                 from src\net.h:11,
                 from src\rpcnet.cpp:6:
c:\mingw\include\winsock.h:315:8: error: previous definition of 'struct ip_mreq'

 struct ip_mreq {
        ^
In file included from src\compat.h:17:0,
                 from src\netbase.h:11,
                 from src\net.h:19,
                 from src\rpcnet.cpp:6:
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,
            ^
In file included from src\cryptopp/pubkey.h:35:0,
                 from src\cryptopp/eccrypto.h:7,
                 from src\schnorr.h:12,
                 from src\hash.h:17,
                 from src\net.h:22,
                 from src\rpcnet.cpp:6:
src\cryptopp/modarith.h: In copy constructor 'CryptoPP::ModularArithmetic::Modul
arArithmetic(const CryptoPP::ModularArithmetic&)':
src\cryptopp/modarith.h:29:2: warning: base class 'class CryptoPP::AbstractRing<
CryptoPP::Integer>' should be explicitly initialized in the copy constructor [-W
extra]
  ModularArithmetic(const ModularArithmetic &ma)
  ^
Makefile.Release:3231: recipe for target 'build/rpcnet.o' failed
mingw32-make: *** [build/rpcnet.o] Error 1


If I try to copy content of winsock2.h and replace ws2tcpip.h, i will get an error at netbase.cpp where it need ws2tcpip.h , so I can't really fix this part

#error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

what should i do..
member
Activity: 84
Merit: 10
I suggest installing MSYS on top of MinGW, makes your life easier and might solve your problem.

what do you mean install msys ontop of mingw I followed the guide to install everything
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
I suggest installing MSYS on top of MinGW, makes your life easier and might solve your problem.
member
Activity: 84
Merit: 10
when I run ming32-make -f Makefile.Release after running qmake I get the following error

Code:
C:\JennyCoin>mingw32-make -f Makefile.Release
cd C:/JennyCoin/src/leveldb && CC=gcc CXX=g++ TARGET_OS=OS_WINDOWS_CROSSCOMPILE mingw32-make OPT="-pipe -fno-keep-inline
-dllexport -D_FORTIFY_SOURCE=2 -O2" libleveldb.a libmemenv.a && ranlib C:/JennyCoin/src/leveldb/libleveldb.a && ranlib C
:/JennyCoin/src/leveldb/libmemenv.a
'CC' is not recognized as an internal or external command,
operable program or batch file.
Makefile.Release:317: recipe for target 'C:/JennyCoin/src/leveldb/libleveldb.a' failed
mingw32-make: *** [C:/JennyCoin/src/leveldb/libleveldb.a] Error 1

C:\JennyCoin>
member
Activity: 84
Merit: 10
The steps for building bitcoin is that the same steps to use to build any wallet for any altcoin?
newbie
Activity: 5
Merit: 0
boost : 1.55.0
Qt : 4.8.5
resource : bitcoin 0.8.0
mingw : 4.8.1
vc:10.0

Quote
make -f makefile.release

c:/deps/boost_1_55_0/boost/thread/mutex.hpp:12:44: fatal error : boost/thread/detail/platform.hpp: No shch file or directory

#include

compilation terminated.
makefile.release:865: recipe for target 'build/bitcoin.o' faild
mingw32-make: *** [build/bitcoin.o] Error 1
member
Activity: 84
Merit: 10
ok I just redid the everything and now I am missing this

C:\MinGW\msys\1.0\msys.bat

Edit: got it working
Pages:
Jump to: