Post
Topic
Board Development & Technical Discussion
Re: Building headless Bitcoin and Bitcoin-qt on Windows
by
bitcoinrulzz
on 06/01/2015, 19:15:04 UTC
Anyone having problems linking with libQt5Gui.a?
I'm using 64bit binaries and have built the steps leading up to Qt qttools-opensource-src-5.3.2 with no issues.  The link for Qtdiag.exe doesn't seem to want to work.  I'm not an expert at this but know the basics and have managed to get up to here with no errors.  I've followed the current instructions as they are (great guide btw!).

I'm wondering how many have actually installed using 64bit.  My next step will be to try with 32 if I can't get this resolved.  Google searches show a similar problem but so far none resolved.


It has been a while since I did a 64bit build. I'll give it a try and report back.


Can you be more specific & detail as to what needs to change in has_binary_operator.hpp

Try wrapping has_binary_operator.hpp code inside an #ifndef Q_MOC_RUN statement:
Code:
--- has_binary_operator.hpp Thu Oct 30 11:47:21 2014
+++ has_binary_operator.hpp Mon Jan 05 23:58:51 2015
@@ -6,6 +6,7 @@
 //
 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
 
+#ifndef Q_MOC_RUN
 #include
 #include
 #include
@@ -227,3 +228,4 @@
 #endif
 
 #include
+#endif



Thanks I see it went further but still getting error after some time...

..\deps\boost_1_57_0/boost/thread/win32/shared_mutex.hpp:53:52: warning: derefer
encing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
C:\Qt\4.8.6\bin\moc.exe -DUNICODE -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT
_THREADSAFE -DUSE_QRCODE -DUSE_UPNP=1 -DSTATICLIB -DUSE_IPV6=1 -DWIN32 -D_MT -DQ
T_THREAD_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_
HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"..\Qt\4.8.6\include\Qt
Core" -I"..\Qt\4.8.6\include\QtNetwork" -I"..\Qt\4.8.6\include\QtGui" -I"..\Qt\4
.8.6\include" -I"src" -I"src\json" -I"src\qt" -I"..\deps" -I"src\leveldb\include
" -I"src\leveldb\helpers" -I"..\deps\boost_1_57_0" -I"..\deps\db-4.8.30.NC\build
_unix" -I"..\deps\openssl-1.0.1j\include" -I"..\deps\qrencode-3.4.4" -I"..\Qt\4.
8.6\include\ActiveQt" -I"build" -I"build" -I"..\Qt\4.8.6\mkspecs\default" -D__GN
UC__ -DWIN32 src\qt\rpcconsole.cpp -o build\rpcconsole.moc
:/deps/boost_1_57_0/boost/type_traits/detail/has_binary_operator.hp:53: Parse er
ror at "BOOST_JOIN"
Makefile.Release:742: recipe for target 'build/rpcconsole.moc' failed
mingw32-make: *** [build/rpcconsole.moc] Error 1






Here is my updated file has_binary_operator.hpp looks like...

Code:
//  (C) Copyright 2009-2011 Frederic Bron, Robert Stewart, Steven Watanabe & Roman Perepelitsa.
//
//  Use, modification and distribution are subject to the Boost Software License,
//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt).
//
//  See http://www.boost.org/libs/type_traits for most recent version including documentation.

#ifndef Q_MOC_RUN
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include


// should be the last #include
#include
#endif


Hi bitcoinrulzz,
You put the last #endif to a wrong line. Put it at the end of file instead, it should work then. (check again nitrogenetics's answer)





Thanks it went further, now getting this error...

Code:
..\deps\boost_1_57_0/boost/thread/win32/shared_mutex.hpp:53:52: warning: derefer
encing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
g++ -Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware -static -static-l
ibgcc -static-libstdc++ -Wl,-s -mthreads -Wl,-subsystem,windows -o release\
coin-qt.exe object_script.coin-qt.Release  -L"c:\Qt\4.8.6\lib" -lmingwt
hrd -lmingw32 -lqtmain build\bitcoin-qt_res.o -lqrencode -LC:/deps/miniupnpc -lm
iniupnpc -liphlpapi C:/bitcoin-0.8.6/src/leveldb/libleveldb.a C:/bitcoin-0.8.6/s
rc/leveldb/libmemenv.a -lshlwapi -LC:/deps/boost_1_57_0/stage/lib -LC:/deps/db-4
.8.30.NC/build_unix -LC:/deps/openssl-1.0.1j -LC:/deps/qrencode-3.4.4/.libs -lss
l -lcrypto -ldb_cxx -lshlwapi -lmswsock -lboost_system-mgw49-mt-s-1_57 -lboost_f
ilesystem-mgw49-mt-s-1_57 -lboost_program_options-mgw49-mt-s-1_57 -lboost_thread
-mgw49-mt-s-1_57 -lboost_chrono-mgw49-mt-s-1_57 -lQtGui -lQtNetwork -lgdi32 -lco
mdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -lole32 -luuid -
lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
./build\net.o:net.cpp:(.text+0x8ba3): undefined reference to `_imp__upnpDiscover
'
./build\net.o:net.cpp:(.text+0x8bda): undefined reference to `_imp__UPNP_GetVali
dIGD'
./build\net.o:net.cpp:(.text+0x8c1b): undefined reference to `_imp__UPNP_GetExte
rnalIPAddress'
./build\net.o:net.cpp:(.text+0x8c97): undefined reference to `_imp__freeUPNPDevl
ist'
./build\net.o:net.cpp:(.text+0x8caa): undefined reference to `_imp__FreeUPNPUrls
'
./build\net.o:net.cpp:(.text+0x8d97): undefined reference to `_imp__strupnperror
'
./build\net.o:net.cpp:(.text+0x8e23): undefined reference to `_imp__UPNP_AddPort
Mapping'
./build\net.o:net.cpp:(.text+0x8eab): undefined reference to `_imp__UPNP_DeleteP
ortMapping'
./build\net.o:net.cpp:(.text+0x8eca): undefined reference to `_imp__freeUPNPDevl
ist'
./build\net.o:net.cpp:(.text+0x8ed9): undefined reference to `_imp__FreeUPNPUrls
'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bi
n/ld.exe: ./build\net.o: bad reloc address 0x3c in section `.data'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bi
n/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Makefile.Release:315: recipe for target 'release\coin-qt.exe' failed
mingw32-make: *** [release\coin-qt.exe] Error 1


I hope this error makes any sense?

Btw, if using "USE_UPNP=-" option, then no issues.