bitcoin compile (.undefined reference to `BlockAssembler::BlockAssembler(CChainParams const&)') - c++

I'm getting error after make command like,
undefined reference to `BlockAssembler::BlockAssembler(CChainParams const&)'
and in last
Makefile:774: recipe for target 'all-recursive' failed
make: **[all-recursive] Error 1
I have followed all steps given here:-
https://www.toshblocks.com/bitcoin/compile-bitcoin-source-code-ubuntu-16-04-lts/
Output :-
Making all in src
make[1]: Entering directory '/home/khushbu/bitcoin/src'
make[2]: Entering directory '/home/khushbu/bitcoin/src'
make[3]: Entering directory '/home/khushbu/bitcoin'
make[3]: Leaving directory '/home/khushbu/bitcoin'
CXXLD bitcoind
libbitcoin_server.a(libbitcoin_server_a-mining.o): In function `generateBlocks(std::shared_ptr<CReserveScript>, int, unsigned long, bool)':
/home/khushbu/bitcoin/src/rpc/mining.cpp:122: undefined reference to `BlockAssembler::BlockAssembler(CChainParams const&)'
/home/khushbu/bitcoin/src/rpc/mining.cpp:122: undefined reference to `BlockAssembler::CreateNewBlock(CScript const&, bool)'
/home/khushbu/bitcoin/src/rpc/mining.cpp:128: undefined reference to `IncrementExtraNonce(CBlock*, CBlockIndex const*, unsigned int&)'
libbitcoin_server.a(libbitcoin_server_a-mining.o): In function `getmininginfo(JSONRPCRequest const&)':
/home/khushbu/bitcoin/src/rpc/mining.cpp:216: undefined reference to `nLastBlockWeight'
/home/khushbu/bitcoin/src/rpc/mining.cpp:217: undefined reference to `nLastBlockTx'
libbitcoin_server.a(libbitcoin_server_a-mining.o): In function `getblocktemplate(JSONRPCRequest const&)':
/home/khushbu/bitcoin/src/rpc/mining.cpp:521: undefined reference to `BlockAssembler::BlockAssembler(CChainParams const&)'
/home/khushbu/bitcoin/src/rpc/mining.cpp:521: undefined reference to `BlockAssembler::CreateNewBlock(CScript const&, bool)'
/home/khushbu/bitcoin/src/rpc/mining.cpp:533: undefined reference to `UpdateTime(CBlockHeader*, Consensus::Params const&, CBlockIndex const*)'
collect2: error: ld returned 1 exit status
Makefile:3888: recipe for target 'bitcoind' failed
make[2]: *** [bitcoind] Error 1
make[2]: Leaving directory '/home/khushbu/bitcoin/src'
Makefile:10190: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/khushbu/bitcoin/src'
Makefile:774: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
How to solve this error and compile bitcoin source code successfully?

This tutorial helped me to solve the issue.
https://www.youtube.com/watch?v=l0A91Yx9juQ
By, Following Unix build notes,
https://github.com/bitcoin/bitcoin/blob/master/doc/build-UNIX.md
and downloading needed dependencies can solve the problem.
I think problem occurred due to bad installation of Berkeley DB,
and so i have remove all old files and then again followed steps from build-UNIX.md.
and download dependencies which are,
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
sudo apt-get install libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
This worked for me. Thank you!

Related

Undefined reference when building AzerothCore module

I followed the steps on how to install azerothcore. I remembered I could add Modules, so I went in the website of azerothcore and downloaded a few modules. Before I downloaded them I checked and saw it says that it's building on master core, but for some reason I have the following error:
/usr/bin/ld: ../../../modules/libmodules.a(ModulesLoader.cpp.o): in function `AddModulesScripts()':
/root/azerothcore/build/modules/gen_scriptloader/static/ModulesLoader.cpp:60: undefined reference to `Addmod_1v1_arena_masterScripts()'
/usr/bin/ld: /root/azerothcore/build/modules/gen_scriptloader/static/ModulesLoader.cpp:61: undefined reference to `Addmod_boss_announcer_masterScripts()'
/usr/bin/ld: /root/azerothcore/build/modules/gen_scriptloader/static/ModulesLoader.cpp:63: undefined reference to `Addmod_npc_buffer_masterScripts()'
/usr/bin/ld: /root/azerothcore/build/modules/gen_scriptloader/static/ModulesLoader.cpp:64: undefined reference to `Addmod_npc_spectator_masterScripts()'
/usr/bin/ld: /root/azerothcore/build/modules/gen_scriptloader/static/ModulesLoader.cpp:65: undefined reference to `Addmod_reward_shop_masterScripts()'
/usr/bin/ld: /root/azerothcore/build/modules/gen_scriptloader/static/ModulesLoader.cpp:66: undefined reference to `Addmod_solocraft_masterScripts()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/server/apps/CMakeFiles/worldserver.dir/build.make:175: src/server/apps/worldserver] Error 1
make[1]: *** [CMakeFiles/Makefile2:1086: src/server/apps/CMakeFiles/worldserver.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
and I am not capable of fixing it. Can anyone please help?
Remove _master from all module subdirectories.
You can avoid this error by using git clone or cloning the modules in general with a git interface, instead of downloading a .zip file.

Trying to install qt-pods on windows

Im trying to install qt-pods on windows.
I downloaded the qt-pods package from github to my pc.
then i went into the folder and tried to run qmake && make.
the qmake succeed with no errors (i did it also alone for checking) but the 'make' threw me the following errors:
...a lot of errors like this...
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.text$_ZN10PodManagerD0Ev[_ZN10PodManagerD0Ev]+0x14): undefined reference to `__imp__ZN7QObjectD2Ev'
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.text.startup+0x3): undefined reference to `__imp__ZN7QObject16staticMetaObjectE'
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.rdata$_ZTV10PodManager[_ZTV10PodManager]+0x38): undefined reference to `QObject::event(QEvent*)'
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.rdata$_ZTV10PodManager[_ZTV10PodManager]+0x40): undefined reference to `QObject::eventFilter(QObject*, QEvent*)'
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.rdata$_ZTV10PodManager[_ZTV10PodManager]+0x48): undefined reference to `QObject::timerEvent(QTimerEvent*)'
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.rdata$_ZTV10PodManager[_ZTV10PodManager]+0x50): undefined reference to `QObject::childEvent(QChildEvent*)'
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.rdata$_ZTV10PodManager[_ZTV10PodManager]+0x58): undefined reference to `QObject::customEvent(QEvent*)'
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.rdata$_ZTV10PodManager[_ZTV10PodManager]+0x60): undefined reference to `QObject::connectNotify(QMetaMethod const&)'
F:\Users\matan_000\Documents\Programming\c++-libraries\qt-pods\qt-pods-core\release/libqt-pods-core.a(moc_podmanager.o):moc_podmanager.cpp:(.rdata$_ZTV10PodManager[_ZTV10PodManager]+0x68): undefined reference to `QObject::disconnectNotify(QMetaMethod const&)'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [Makefile.Release:87: release\qt-pods-gui.exe] Error 1
make[2]: Leaving directory 'F:/Users/matan_000/Documents/Programming/c++-libraries/qt-pods/qt-pods-gui'
make[1]: *** [Makefile:36: release] Error 2
make[1]: Leaving directory 'F:/Users/matan_000/Documents/Programming/c++-libraries/qt-pods/qt-pods-gui'
make: *** [Makefile:95: sub-qt-pods-gui-make_first] Error 2
and a lot of errors like this before...
Im almost hopeless...
I will be happy to help! thank you! :)

Unable to build surround360_render - CMake issue

Background
I am running this on Kubuntu 16.04.04 LTS, a fresh install.
I'm trying to build surround360_render based on the code and instructions at: https://github.com/facebook/Surround360/tree/master/surround360_render
I followed the instructions except for the ones for the python, numpy, pip. gooey, pil installs (I don't need python).
Installed ceres based on the instructions here, not the ones on the ceres git page.
installed llvm, Halide to use accelerated ISP
and I get the following error while make'ing ...360_render:
[ 92%] Linking CXX executable bin/Unpacker
//usr/local/lib/libfolly.a(Conv.cpp.o): In function `folly::Expected<float, folly::ConversionCode> folly::detail::str_to_floating<float>(folly::Range<char const*>*)':
/home/rinka/bin/fb-lib/folly/folly/folly/Conv.cpp:354: undefined reference to `double_conversion::StringToDoubleConverter::StringToDouble(char const*, int, int*) const'
//usr/local/lib/libfolly.a(Conv.cpp.o): In function `folly::Expected<double, folly::ConversionCode> folly::detail::str_to_floating<double>(folly::Range<char const*>*)':
/home/rinka/bin/fb-lib/folly/folly/folly/Conv.cpp:354: undefined reference to `double_conversion::StringToDoubleConverter::StringToDouble(char const*, int, int*) const'
//usr/local/lib/libfolly.a(dynamic.cpp.o): In function `double_conversion::DoubleToStringConverter::ToShortest(double, double_conversion::StringBuilder*) const':
/usr/local/include/double-conversion/double-conversion.h:158: undefined reference to `double_conversion::DoubleToStringConverter::ToShortestIeeeNumber(double, double_conversion::StringBuilder*, double_conversion::DoubleToStringConverter::DtoaMode) const'
//usr/local/lib/libfolly.a(dynamic.cpp.o): In function `std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type folly::toAppend<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>(double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int)':
/home/rinka/bin/fb-lib/folly/folly/folly/Conv.h:704: undefined reference to `double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const'
/home/rinka/bin/fb-lib/folly/folly/folly/Conv.h:708: undefined reference to `double_conversion::DoubleToStringConverter::ToPrecision(double, int, double_conversion::StringBuilder*) const'
//usr/local/lib/libfolly.a(Format.cpp.o): In function `folly::FormatValue<double, void>::formatHelper(folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >&, int&, folly::FormatArg&) const':
/home/rinka/bin/fb-lib/folly/folly/folly/Format.cpp:162: undefined reference to `double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const'
/home/rinka/bin/fb-lib/folly/folly/folly/Format.cpp:181: undefined reference to `double_conversion::DoubleToStringConverter::ToExponential(double, int, double_conversion::StringBuilder*) const'
collect2: error: ld returned 1 exit status
CMakeFiles/TestRenderStereoPanorama.dir/build.make:112: recipe for target 'bin/TestRenderStereoPanorama' failed
make[2]: *** [bin/TestRenderStereoPanorama] Error 1
CMakeFiles/Makefile2:556: recipe for target 'CMakeFiles/TestRenderStereoPanorama.dir/all' failed
make[1]: *** [CMakeFiles/TestRenderStereoPanorama.dir/all] Error 2
[ 96%] Built target Unpacker
[ 96%] Built target GeometricCalibration
Makefile:83: recipe for target 'all' failed
What I've tried so far
I tried implementing https://github.com/facebook/Surround360/issues/253 Failed. I get the following message:
[ 98%] Generating folly_dep.cpp
Scanning dependencies of target folly
[ 98%] Building CXX object CMakeFiles/folly.dir/folly_dep.cpp.o
[ 99%] Linking CXX shared library libfolly.so
/usr/bin/ld: CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/folly.dir/build.make:514: recipe for target 'libfolly.so' failed
make[2]: *** [libfolly.so] Error 1
CMakeFiles/Makefile2:180: recipe for target 'CMakeFiles/folly.dir/all' failed
make[1]: *** [CMakeFiles/folly.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
assuming it is a problem with the standard double-conversion-dev library installed by apt, I uninstalled that, recompiled double-conversion using the following instructions:
git clone https://github.com/google/double-conversion.git
cd double-conversion
cmake -DBUILD_SHARED_LIBS=ON .
make -j $(nproc)
sudo make install
and rebuilt folly as follows:
$ cmake configure ..
$ make -j $(nproc)
didn't work. redid cmake & make
$ cmake configure "-DCMAKE_INCLUDE_PATH=$HOME/bin/fb-lib/double-conversion/build/include" "-DCMAKE_LIBRARY_PATH=$HOME/bin/fb-lib/double-conversion/build//lib" ..
$ make -j $(nproc)
I get the following error:
CMake Error at CMakeLists.txt:201 (find_package):
Could not find a package configuration file provided by "double-conversion"
with any of the following names:
double-conversionConfig.cmake
double-conversion-config.cmake
Add the installation prefix of "double-conversion" to CMAKE_PREFIX_PATH or
set "double-conversion_DIR" to a directory containing one of the above
files. If "double-conversion" provides a separate development package or
SDK, be sure it has been installed.
The issues were because "double-conversion" was not included as a library to be linked in the various modules of surround360_render. To solve the problem, modify CMakeLists.txt under the directory surround360_render as follows:
Add:
double-conversion
to the sections TARGET_LINK_LIBRARIES of the various modules that fail. In my case the failed modules were: TestRenderStereoPanorama, TestHyperPreview, TestPoleRemoval, TestColorCalibration, TestVignettingCalibration, TestVignettingDataAcquisition and GeometricCalibration
The reason I list these, there are more modules than these which is why one doesn't need to add double-conversion as a default library to be linked.
Putting this here in case someone else runs into similar issues.

Linking to boost libraries when building pcl-1.7.1 from source

I have downloaded the pcl-1.7.1 release from github and have tried to build the code using
cd PCL-1.6.0 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
The cmake command runs successful and and writes this concerning boost
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
The problem comes with the make command which after some time returns the following error:
Scanning dependencies of target pcl_convert_pcd_ascii_binary
[ 12%] Building CXX object io/tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/convert_pcd_ascii_binary.cpp.o
Linking CXX executable ../../bin/pcl_convert_pcd_ascii_binary
../../lib/libpcl_common.so.1.7.1: error: undefined reference to 'boost::thread::join_noexcept()'
../../lib/libpcl_common.so.1.7.1: error: undefined reference to 'boost::thread::start_thread_noexcept()'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::permissions(boost::filesystem::path const&, boost::filesystem::perms, boost::system::error_code*)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::path::extension() const'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::dir_itr_close(void*&, void*&)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::path::stem() const'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, boost::system::error_code*)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::directory_iterator_increment(boost::filesystem::directory_iterator&, boost::system::error_code*)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::directory_entry::m_get_status(boost::system::error_code*) const'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::thread::do_try_join_until_noexcept(timespec const&, bool&)'
collect2: ld returned 1 exit status
make[2]: *** [bin/pcl_convert_pcd_ascii_binary] Error 1
make[1]: *** [io/tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/all] Error 2
make: *** [all] Error 2
Is it correct that this is a linking problem? can it be the boost installation that causes the problem?
I have built the boost library from source (version 1.55.0) by executing the following inside the boost_1_55_0 directory
sudo ./bootstrap
sudo ./b2 install
The boost is then installed in /usr/local/include and /usr/local/lib
I use 32 bit Ubuntu 12.04
I found some libboost files in /usr/lib which I forgot to delete from the last install of boost (as pointed out by #D.J.Duff). Removing those files and intstalling boost again fixed the problem.

How to build zeromq on windows with cygwin?

I am trying to build zeromq under Windows 7 (x64) with cygwin (x64) and gcc(x86_64)>=4.
configure works but the make step crashes when it reaches curve_keygen.exe
Making all in tools
make[1]: Entering directory '/e/0MQ/zeromq-4.0.3/tools'
CC curve_keygen.o
CCLD curve_keygen.exe
../src/.libs/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.data+0x0): undefined reference to `__gxx_personality_seh0'
../src/.libs/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.xdata+0x30): undefined reference to `__gxx_personality_seh0'
../src/.libs/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.xdata+0x30): relocation truncated to fit: rva32 against undefined symbol `__gxx_personality_seh0'
../src/.libs/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.xdata+0x1c0): undefined reference to `__gxx_personality_seh0'
../src/.libs/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.xdata+0x1c0): relocation truncated to fit: rva32 against undefined symbol `__gxx_personality_seh0'
../src/.libs/libzmq.a(libzmq_la-zmq.o):zmq.cpp:(.rdata$.refptr._ZSt7nothrow[.refptr._ZSt7nothrow]+0x0): undefined reference to `std::nothrow'
../src/.libs/libzmq.a(libzmq_la-socket_base.o): In function `zmq::socket_base_t::parse_uri(char const*, std::string&, std::string&)':
.
.
.
collect2: error: ld returned 1 exit status
Makefile:394: recipe for target 'curve_keygen.exe' failed
make[1]: *** [curve_keygen.exe] Error 1
make[1]: Leaving directory '/e/0MQ/zeromq-4.0.3/tools'
Makefile:412: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
What do I need to do to build zeromq under windows with cygwin.
This indicates that libzmq.la is a C++ library, not a C library. Not sure why that is (it shouldn't) but here is a workaround:
mv tools/curve_keygen.c tools/curve_keygen.cpp
sed -i 's/\.c\>/&pp/' tools/Makefile.am
rm -f tools/.deps/curve_keygen.Po
./autogen.sh
make
This will compile curve_keygen.exe, but does not solve the question of why libzmq.la has C++ dependencies under Cygwin.