Pages:
Author

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

sr. member
Activity: 260
Merit: 251
please help

i try compile bitcoind got that error

and i try this
From a windows command prompt configure and make:
Code:
set PATH=%PATH%;C:\Qt\4.8.5\bin
cd C:\qcoin\
qmake "USE_QRCODE=1" "USE_UPNP=1" "USE_IPV6=1" qcoin-qt.pro
got that error
Hello tweminer

I don't really understand you, since you haven't asked any questions that I could answer, but I can guess...?

In the first pix, I see that the build you are using is trying to link libmemenv.a and it can't seem to find what it needs.  Perhaps it can't find libleveldb.a or the parts therein, for whatever reason?  You're in a "qcoin" directory, so perhaps you didn't build it?  Or build it correctly?  Or configure your build system to know where to look for it?

In the second pix, I see that C:/Qt/4.8.5/bin\lrelease.exe is not being "seen" by your OS, whatever that is?  Again I see qcoin, whatever that is, and your path being set, so technically lrelease.exe doesn't need a fully qualified path in order for the OS to run it?  I can't see what else is down there past the bottom of your screen, but it might give you some more insight as to what is going on.

Ron
newbie
Activity: 56
Merit: 0
please help
http://tryimg.com/thumbs/edgd.jpg
i try compile bitcoind got that error
http://tryimg.com/thumbs/error.jpg
and i try this
From a windows command prompt configure and make:
Code:
set PATH=%PATH%;C:\Qt\4.8.5\bin
cd C:\qcoin\
qmake "USE_QRCODE=1" "USE_UPNP=1" "USE_IPV6=1" qcoin-qt.pro
got that error
sr. member
Activity: 260
Merit: 251
Quote
What's interesting is that the compiler "warnings" about the bad C++ slang that is being used, as opposed to the preferred slang, i.e. the highly idiomatic, baroque (as Knuth calls it) nature of C++, can be controlled in MSVC++ and one can "see" more clearly what is "going on".  The thought is that this should lead to more understanding, but so far, the answers given are swamped by the questions that now appear!  Which is why you haven't heard from me (yet) on the Windows MSVC2005 version of bitcoind.  I have a "debug" version of bitcoind 0.8.6 that "appears to" run correctly.  And yes, Claire123 has a MSVC2012 version of bitcoind (& bitcoin-qt), but do our versions work correctly?  Do we have 'release' versions?  I am hoping to "GitHub" commit-pull request my MSVC "additions" to the bitcoind sources soon, but only when I feel that the code runs reliably. 
...
Ron

Hello all,

Well I do now! Grin  See https://github.com/bc4-old-c-coder/bitcoin/commit/f0d221e56a12947b67b9c8f43cc5832b665052c8

I feel pretty confident in it.  Release & debug modes, links with OpenSSL1.0.1g, and so on...
Here it is running at startup


Ron
newbie
Activity: 25
Merit: 0
I followed this guide loosely and successfully compiled OpenSSL, BDB and Boost (compiling for the headless version, so no QT, protoc, libpng or qrencode needed). Then I set the appropriate include and library files in the gcc specs file, so that they could be found and ran autogen.sh and configure. All went well and a makefile was generated in the root directory, which I ran. It compiled all modules successfully and then tried to build bitcoind (I believe), outputting:

Code:
Making all in src
make[1]: Entering directory `/i/code/bitcoin_git/bitcoin/src'
make  all-recursive
make[2]: Entering directory `/i/code/bitcoin_git/bitcoin/src'
Making all in .
make[3]: Entering directory `/i/code/bitcoin_git/bitcoin/src'
  CXXLD  bitcoind.exe

This failed however with a host of errors (I included the head only, but I think the problem can be derived from this, as the other errors are very alike):

Code:
libbitcoin_server.a(main.o): In function `CLevelDBBatch':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.h:25: undefined reference to `leveldb::WriteBatch::WriteBatch()'
libbitcoin_server.a(main.o): In function `~CLevelDBBatch':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.h:25: undefined reference to `leveldb::WriteBatch::~WriteBatch()'
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.h:25: undefined reference to `leveldb::WriteBatch::~WriteBatch()'
libbitcoin_server.a(leveldbwrapper.o): In function `Z11HandleErrorRKN7leveldb6StatusE':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.cpp:18: undefined reference to `leveldb::Status::ToString() const'
libbitcoin_server.a(leveldbwrapper.o): In function `ZN15CLevelDBWrapperC2ERKN5boost10filesystem4pathEjbb':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.cpp:38: undefined reference to `leveldb::Options::Options()'
libbitcoin_server.a(leveldbwrapper.o): In function `GetOptions':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.cpp:29: undefined reference to `leveldb::Options::Options()'
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.cpp:30: undefined reference to `leveldb::NewLRUCache(unsigned int)'
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.cpp:32: undefined reference to `leveldb::NewBloomFilterPolicy(int)'
libbitcoin_server.a(leveldbwrapper.o): In function `ZN15CLevelDBWrapperC2ERKN5boost10filesystem4pathEjbb':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.cpp:52: undefined reference to `leveldb::DestroyDB(std::string const&, leveldb::Options const&)'
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.cpp:57: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.cpp:47: undefined reference to `leveldb::Env::Default()'
libbitcoin_server.a(txdb.o): In function `CLevelDBBatch':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.h:25: undefined reference to `leveldb::WriteBatch::WriteBatch()'
libbitcoin_server.a(txdb.o): In function `Write':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.h:44: undefined reference to `leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)'
libbitcoin_server.a(txdb.o): In function `~CLevelDBBatch':
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.h:25: undefined reference to `leveldb::WriteBatch::~WriteBatch()'
i:\code\bitcoin_git\bitcoin\src/leveldbwrapper.h:25: undefined reference to `leveldb::WriteBatch::~WriteBatch()'
...
...
...

I checked if libleveldb.a and libmemenv.a were available, and they were (located at .../src/leveldb).

Could anyone point me in the right direction?
legendary
Activity: 3248
Merit: 1070
so many things to install, there isn't an easy way? like a compiler with all those things packed in?
newbie
Activity: 12
Merit: 0
I checked the feathercoin-qt.pro file
sr. member
Activity: 308
Merit: 250
newbie
Activity: 18
Merit: 0
Hello,
On step 2.6 PKG_CONFIG enviroment variable issue. How to avoid png_CFLAG not to call PKG
hero member
Activity: 938
Merit: 500
Looks like you have changed something in source code?
Nope, this source code is from ECCoin:
https://github.com/eccoin/eccoin

I did not change.

OK, ECC, MINT, GRAIN and other such clones you need to compile with QT4.8. You could use easywinbuilder script for them. They should compile just fine with it.
I managed to port to compile with QT5.2 as well, but it takes some code changes for it to work.

I am compiling with QT 4.8.5. Where can I find easywinbuilder?

BTW, I found that this issue only happens if I use dynamic libraries from boost. If I use static library, then the compilation works fine.
hero member
Activity: 546
Merit: 500
Looks like you have changed something in source code?
Nope, this source code is from ECCoin:
https://github.com/eccoin/eccoin

I did not change.

OK, ECC, MINT, GRAIN and other such clones you need to compile with QT4.8. You could use easywinbuilder script for them. They should compile just fine with it.
I managed to port to compile with QT5.2 as well, but it takes some code changes for it to work.
hero member
Activity: 938
Merit: 500
Looks like you have changed something in source code?
Nope, this source code is from ECCoin:
https://github.com/eccoin/eccoin

I did not change.
hero member
Activity: 546
Merit: 500
Looks like you have changed something in source code?
hero member
Activity: 938
Merit: 500
I've been following your method to build alt coins, for most it works fine. But when I try to build some coins based on Litecoin 0.6.3, I got this link error. Any insights on what happened there?

Code:
g++ -c -pipe -msse2 -O2 -frtti -fexceptions -mthreads -fdiagnostics-show-option
-Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector
 -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT
_THREADSAFE -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN -D__NO_SYSTEM_IN
CLUDES -DUSE_UPNP=1 -DSTATICLIB -DUSE_IPV6=1 -DWIN32 -D_MT -DQT_DLL -DQT_NO_DEBU
G -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HA
VE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../Qt/4.8.4/
include/QtCore' -I'../../Qt/4.8.4/include/QtGui' -I'../../Qt/4.8.4/include' -I's
rc' -I'src/json' -I'src/qt' -I'e:/' -I'e:/boost_1_55_0' -I'e:/db-4.8.30.NC/build
_unix' -I'e:/openssl-1.0.1f/include' -I'../../Qt/4.8.4/include/ActiveQt' -I'buil
d' -I'build' -I'../../Qt/4.8.4/mkspecs/default' -o build/qrc_bitcoin.o release/q
rc_bitcoin.cpp
windres -i src/qt/res/bitcoin-qt.rc -o build/bitcoin-qt_res.o --include-dir=./sr
c/qt/res -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOS
T_SPIRIT_THREADSAFE -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN -D__NO_S
YSTEM_INCLUDES -DUSE_UPNP=1 -DSTATICLIB -DUSE_IPV6=1 -DWIN32 -D_MT -DQT_DLL -DQT
_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE
 -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
g++ -Wl,--dynamicbase -Wl,--nxcompat -Wl,-s -mthreads -Wl,-subsystem,windows -o
release/eccoin-qt.exe object_script.eccoin-qt.Release  -L'c:/Qt/4.8.4/lib' -lmin
gwthrd -lmingw32 -lqtmain build/bitcoin-qt_res.o -LE:/miniupnpc -lminiupnpc -lip
hlpapi -LE:/boost_1_55_0/stage/lib -LE:/db-4.8.30.NC/build_unix -LE:/openssl-1.0
.1f -lssl -lcrypto -ldb_cxx -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luu
id -lgdi32 -lboost_system-mgw48-mt-d-1_55 -lboost_filesystem-mgw48-mt-d-1_55 -lb
oost_program_options-mgw48-mt-d-1_55 -lboost_thread-mgw48-mt-d-1_55 -lboost_chro
no-mgw48-mt-d-1_55 -lQtGui4 -lQtCore4
./build/util.o:util.cpp:(.text+0x4ae5): undefined reference to `boost::program_o
ptions::detail::common_config_file_iterator::get()'
./build/util.o:util.cpp:(.text$_ZN5boost15program_options6detail26basic_config_f
ile_iteratorIcEC1ERSiRKSt3setISsSt4lessISsESaISsEEb[__ZN5boost15program_options6
detail26basic_config_file_iteratorIcEC1ERSiRKSt3setISsSt4lessISsESaISsEEb]+0x1c)
: undefined reference to `boost::program_options::detail::common_config_file_ite
rator::common_config_file_iterator(std::set,
 std::allocator > const&, bool)'
e:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/bi
n/ld.exe: ./build/util.o: bad reloc address 0x1c in section `.text$_ZN5boost15pr
ogram_options6detail26basic_config_file_iteratorIcEC1ERSiRKSt3setISsSt4lessISsES
aISsEEb[__ZN5boost15program_options6detail26basic_config_file_iteratorIcEC1ERSiR
KSt3setISsSt4lessISsESaISsEEb]'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:259: recipe for target 'release/eccoin-qt.exe' failed
mingw32-make: *** [release/eccoin-qt.exe] Error 1
newbie
Activity: 30
Merit: 0

So either a conversion from Unix LF to Windows CR+LF on those files is needed, or just use mingw to compile it using "$ make -f Makefile.mingw init upnpc-static" from msys instead of Windows command prompt.


Miniupnpc compiles fine from both msys and cmd producing identical binaries, so it's just a matter of preference which one you compile from.


Well, that is correct for now, but since the package contains all files with the Unix style end-of-line, I prefer to use MSYS on Windows, so I am sure that nothing breaks now, nor will in the future.

Also note that one of the batch files in the miniupnpc folder is named 'mingw32make.bat', very similar to the command that you instruct to use, 'mingw32-make', if the user has Windows CLI completion enable, and type the first few letter then auto-complete, that batch file will be used causing problems... also in Windows batch file can be called without the .bat extension, making this one even more similar to the actual command that we want to use.

... but yes for now is just matter of preference.
full member
Activity: 131
Merit: 108
... I find out that actually there are a lot of them (batch files) with the "wrong" end-of-line encoding, in some it does not cause any problem, but in some it does (depending on parsing engine), so if you have those files the best course of action is to search for and open all of them (*.bat) in something like NotePad++ and convert all the end-of-line to windows style and save all the files.
This should fix some if not all of the problems peps are having while compiling boost on windows.


Boost tarballs contain unix EOL encoded files, the easyest way is to use either the zip or the 7z archive containing windows EOL files.


So either a conversion from Unix LF to Windows CR+LF on those files is needed, or just use mingw to compile it using "$ make -f Makefile.mingw init upnpc-static" from msys instead of Windows command prompt.


Miniupnpc compiles fine from both msys and cmd producing identical binaries, so it's just a matter of preference which one you compile from.


About this part... actually there is already a directive in the makefile.mingw that does exactly that... from msys while in the bitcoin src directory, call:
Code:
make -f makefile.mingw leveldb/libleveldb.a

Yes, this is a remnant from older versions, it probably makes more sense compiling bitcoind from msys instead of building leveldb from msys then bitcoind from cmd Wink
newbie
Activity: 30
Merit: 0

Compile bitcoind https://github.com/bitcoin/bitcoin/archive/v0.8.6.zip
Leveldb libraries will not compile automatically so we'll need to compile them first.

Extract bitcoin-0.8.6.zip (for example to C:\) then start MinGW shell and change into leveldb folder:
Code:
cd /C/bitcoin-0.8.6/src/leveldb
TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a

this will compile both libleveldb.a and libmemenv.a libraries required by bitcoin.


About this part... actually there is already a directive in the makefile.mingw that does exactly that... from msys while in the bitcoin src directory, call:
Code:
make -f makefile.mingw leveldb/libleveldb.a
newbie
Activity: 30
Merit: 0

2.4 Miniupnpc: http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.tar.gz
Unpack Miniupnpc to C:\deps, rename containing folder from "miniupnpc-1.9" to "miniupnpc" then from a Windows command prompt:
Code:
cd C:\deps\miniupnpc
mingw32-make -f Makefile.mingw init upnpc-static

This part has a problem. On windows if you download the tar.gz file, depending on how you unpack it, most of the time you will end up with files that may not run correctly like the two batch files in it... again the reason is that those files from the package have the Unix end-of-line encoding (LF) and will not work correctly used from windows console (cmd.com).
So either a conversion from Unix LF to Windows CR+LF on those files is needed, or just use mingw to compile it using "$ make -f Makefile.mingw init upnpc-static" from msys instead of Windows command prompt.
newbie
Activity: 30
Merit: 0
I am unable to get boost installed I have followed this guide and still when I run the command to install boost it cannot find gcc any ideas

Code:

C:\deps\boost_1_55_0>bootstrap.bat mingw
Building Boost.Build engine
'gcc' is not recognized as an internal or external command,
operable program or batch file.

Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.

You can try to obtain a prebuilt binary from

   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.

C:\deps\boost_1_55_0>



Traverse to: $BOOSTDIR/tools/build/v2/engine/build.bat

and at like line 93 before :Guess_Toolset

put 3 spaces(new lines) in

then after that, type out cmd /c 'bootstrap.bat mingw'

There ya go.

This would not fix the problem... which is the actual $BOOSTDIR/tools/build/v2/engine/build.bat you are using has been coded with Unix style end-of-line (LF) instead of windows style end-of-line (CR+LF), so since it is a batch (.bat) file to be ran inside the regular windows console (CMD.COM) it will fail to execute correctly.
The solution is to open the file $BOOSTDIR/tools/build/v2/engine/build.bat with and appropriate editor that can convert the end-of-line encoding to the correct one (CR+LF)... something like NotePad2 or NotePad++ or anything else of your liking that has this feature.

EDIT (after more checking...):
... I find out that actually there are a lot of them (batch files) with the "wrong" end-of-line encoding, in some it does not cause any problem, but in some it does (depending on parsing engine), so if you have those files the best course of action is to search for and open all of them (*.bat) in something like NotePad++ and convert all the end-of-line to windows style and save all the files.
This should fix some if not all of the problems peps are having while compiling boost on windows.

(Anyway this problem mainly arise when the boost tar.gz packaged file is extracted (tar xvfz) on windows, so it should not arise if you use the boost .zip file, that supposedly and hopefully has the end-of-line of the batch files (.bat) encoded for the purpose of being open and used on windows.)

P.S.:
those solution should also fix the problem in windows where you get:
Code:
    Prompt>bootstrap.bat mingw
    Building Boost.Build engine
    '"VCVARS32.BAT"' is not recognized as an internal or external command
    operable program or batch file.
    '"VCVARS32.BAT"' is not recognized as an internal or external command
    operable program or batch file.
    '"VCVARS32.BAT"' is not recognized as an internal or external command
    operable program or batch file.
    '"VCVARS32.BAT"' is not recognized as an internal or external command
    operable program or batch file.
    'cl' is not recognized as an internal or external command,
    operable program or batch file.
newbie
Activity: 5
Merit: 0
Pages:
Jump to: