Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost linking issue #89

Closed
hippich opened this issue Aug 3, 2018 · 18 comments
Closed

Boost linking issue #89

hippich opened this issue Aug 3, 2018 · 18 comments

Comments

@hippich
Copy link

hippich commented Aug 3, 2018

I am trying build openmonero with Boost 1.67 (tried 1.58 and 1.62 before with similar results) and getting weird linking errors. It does not quite make sense to me, but was wondering if someone else know what is going on.

Errors:

src/libmyxrm.a(CurrentBlockchainStatus.cpp.o): In function `boost::this_thread::sleep_for(boost::chrono::duration<long, boost::ratio<1l, 1000000000l> > const&)':
CurrentBlockchainStatus.cpp:(.text._ZN5boost11this_thread9sleep_forERKNS_6chrono8durationIlNS_5ratioILl1ELl1000000000EEEEE[_ZN5boost11this_thread9sleep_forERKNS_6chrono8durationIlNS_5ratioILl1ELl1000000000EEEEE]+0x37): undefined reference to `boost::this_thread::hiden::sleep_for(timespec const&)'
src/libmyxrm.a(rpccalls.cpp.o): In function `bool boost::regex_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)':
rpccalls.cpp:(.text._ZN5boost11regex_matchIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS_9sub_matchISB_EEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SJ_RNS_13match_resultsISJ_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsE[_ZN5boost11regex_matchIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS_9sub_matchISB_EEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SJ_RNS_13match_resultsISJ_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsE]+0x8f): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match()'
src/libmyxrm.a(rpccalls.cpp.o): In function `bool boost::regex_search<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)':
rpccalls.cpp:(.text._ZN5boost12regex_searchIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS_9sub_matchISB_EEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SJ_RNS_13match_resultsISJ_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsESJ_[_ZN5boost12regex_searchIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS_9sub_matchISB_EEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SJ_RNS_13match_resultsISJ_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsESJ_]+0xba): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find()'
src/libmyxrm.a(rpccalls.cpp.o): In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)':
rpccalls.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS_9sub_matchISC_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEC2ESC_SC_RNS_13match_resultsISC_SF_EERKNS_11basic_regexIcSJ_EENS_15regex_constants12_match_flagsESC_[_ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEESaINS_9sub_matchISC_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEC5ESC_SC_RNS_13match_resultsISC_SF_EERKNS_11basic_regexIcSJ_EENS_15regex_constants12_match_flagsESC_]+0x116): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
collect2: error: ld returned 1 exit status
CMakeFiles/openmonero.dir/build.make:134: recipe for target 'openmonero' failed
make[2]: *** [openmonero] Error 1
CMakeFiles/Makefile2:69: recipe for target 'CMakeFiles/openmonero.dir/all' failed
make[1]: *** [CMakeFiles/openmonero.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

This is build-script I am using:

#!/bin/bash

export CFLAGS='-fPIC' CXXFLAGS='-fPIC'
export OPENSSL_USE_STATIC_LIBS=TRUE
export BOOST_ROOT=/path/to/projects/deps/installed DEVELOPER_LOCAL_TOOLS=1
export LIBRARY_PATH=/path/to/projects/deps/installed/lib:/path/to/projects/monero/build/release/external/unbound

sudo apt install libpcsclite1 libpcsclite-dev libmysql++-dev libcurl3 libcurl3-dev lcov

cd openmonero

rm -rf build
mkdir build
cd build
cmake \
  -DMONERO_DIR=/path/to/projects/monero \
  -DCMAKE_PREFIX_PATH=/path/to/projects/deps/installed \
  -Dssl_LIBRARY=/path/to/projects/deps/installed/lib/libssl.a \
  -Dssl_INCLUDE=/path/to/projects/deps/installed/include \
  -Dcrypto_LIBRARY=/path/to/projects/deps/installed/lib/libcrypto.a \
  ..
make

Latest dev-version of monero builds just fine by the way.

@moneroexamples
Copy link
Owner

Which openmonero branch and Linux?

@hippich
Copy link
Author

hippich commented Aug 3, 2018

this is for master on Ubuntu 16.04. I do compile boost and other monero dependencies separately tho, so not using packaged boost. I will look into use_blocks_range branch

@moneroexamples
Copy link
Owner

Yes please, have a look at use_blocks_range. master is not being worked on these days. All development is happening in use_blocks_range.

@hippich
Copy link
Author

hippich commented Aug 3, 2018

So I am trying to build it and getting bunch of compile-time errors (unlike master). It feels to me that I am using wrong version of something related to compiler, but I am not too good with C++ tools. Any advise on these?

[ 44%] Building CXX object src/CMakeFiles/myxrm.dir/CurrentBlockchainStatus.cpp.o
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /path/to/projects/openmonero/src/MicroCore.h:8,
                 from /path/to/projects/openmonero/src/CurrentBlockchainStatus.h:7,
                 from /path/to/projects/openmonero/src/CurrentBlockchainStatus.cpp:5:
/usr/include/c++/5/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >; _Args = {const std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, xmreg::ThreadRAII2<xmreg::TxSearch> >&}; _Tp = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >]’:
/usr/include/c++/5/bits/alloc_traits.h:530:4:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >; _Args = {const std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, xmreg::ThreadRAII2<xmreg::TxSearch> >&}; _Tp = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > > >]’
/usr/include/c++/5/bits/stl_tree.h:529:32:   required from ‘void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_construct_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type, _Args&& ...) [with _Args = {const std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, xmreg::ThreadRAII2<xmreg::TxSearch> >&}; _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >*]’
/usr/include/c++/5/bits/stl_tree.h:546:21:   required from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {const std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, xmreg::ThreadRAII2<xmreg::TxSearch> >&}; _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >*]’
/usr/include/c++/5/bits/stl_tree.h:459:62:   required from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Alloc_node::operator()(_Arg&&) const [with _Arg = const std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >&; _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >*]’
/usr/include/c++/5/bits/stl_tree.h:1538:29:   required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr, _Arg&&, _NodeGen&) [with _Arg = const std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >&; _NodeGen = std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > > >::_Alloc_node; _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr = std::_Rb_tree_node_base*]’
/usr/include/c++/5/bits/stl_tree.h:1897:26:   required from ‘std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = const std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >&; _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >]’
/usr/include/c++/5/bits/stl_map.h:614:41:   required from ‘std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = xmreg::ThreadRAII2<xmreg::TxSearch>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> > >; std::map<_Key, _Tp, _Compare, _Alloc>::value_type = std::pair<const std::__cxx11::basic_string<char>, xmreg::ThreadRAII2<xmreg::TxSearch> >]’
/path/to/projects/openmonero/src/CurrentBlockchainStatus.cpp:680:71:   required from here
/usr/include/c++/5/ext/new_allocator.h:120:4: error: use of deleted function ‘constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = xmreg::ThreadRAII2<xmreg::TxSearch>]’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /path/to/projects/openmonero/src/MicroCore.h:8,
                 from /path/to/projects/openmonero/src/CurrentBlockchainStatus.h:7,
                 from /path/to/projects/openmonero/src/CurrentBlockchainStatus.cpp:5:
/usr/include/c++/5/bits/stl_pair.h:127:17: note: ‘constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = xmreg::ThreadRAII2<xmreg::TxSearch>]’ is implicitly deleted because the default definition would be ill-formed:
       constexpr pair(const pair&) = default;
                 ^
/usr/include/c++/5/bits/stl_pair.h:127:17: error: use of deleted function ‘xmreg::ThreadRAII2<xmreg::TxSearch>::ThreadRAII2(const xmreg::ThreadRAII2<xmreg::TxSearch>&)’
In file included from /path/to/projects/openmonero/src/CurrentBlockchainStatus.h:13:0,
                 from /path/to/projects/openmonero/src/CurrentBlockchainStatus.cpp:5:
/path/to/projects/openmonero/src/ThreadRAII.h:35:7: note: ‘xmreg::ThreadRAII2<xmreg::TxSearch>::ThreadRAII2(const xmreg::ThreadRAII2<xmreg::TxSearch>&)’ is implicitly deleted because the default definition would be ill-formed:
 class ThreadRAII2 : public ThreadRAII
       ^
/path/to/projects/openmonero/src/ThreadRAII.h:35:7: error: use of deleted function ‘xmreg::ThreadRAII::ThreadRAII(const xmreg::ThreadRAII&)’
/path/to/projects/openmonero/src/ThreadRAII.h:15:7: note: ‘xmreg::ThreadRAII::ThreadRAII(const xmreg::ThreadRAII&)’ is implicitly declared as deleted because ‘xmreg::ThreadRAII’ declares a move constructor or move assignment operator
 class ThreadRAII
       ^
/path/to/projects/openmonero/src/ThreadRAII.h:35:7: error: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = xmreg::TxSearch; _Dp = std::default_delete<xmreg::TxSearch>]’
 class ThreadRAII2 : public ThreadRAII
       ^
In file included from /usr/include/c++/5/memory:81:0,
                 from /usr/include/boost/config/no_tr1/memory.hpp:21,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:23,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /path/to/projects/monero/contrib/epee/include/net/http_client.h:31,
                 from /path/to/projects/openmonero/src/monero_headers.h:21,
                 from /path/to/projects/openmonero/src/MicroCore.h:11,
                 from /path/to/projects/openmonero/src/CurrentBlockchainStatus.h:7,
                 from /path/to/projects/openmonero/src/CurrentBlockchainStatus.cpp:5:
/usr/include/c++/5/bits/unique_ptr.h:359:7: note: declared here
       unique_ptr(const unique_ptr&) = delete;
       ^
src/CMakeFiles/myxrm.dir/build.make:134: recipe for target 'src/CMakeFiles/myxrm.dir/CurrentBlockchainStatus.cpp.o' failed
make[2]: *** [src/CMakeFiles/myxrm.dir/CurrentBlockchainStatus.cpp.o] Error 1
CMakeFiles/Makefile2:124: recipe for target 'src/CMakeFiles/myxrm.dir/all' failed
make[1]: *** [src/CMakeFiles/myxrm.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

@moneroexamples
Copy link
Owner

I think it could be because openmonero in the development branch is using C++14. I will install ubuntu 16.04 and check myself. Maybe ubuntu 16.04 does not fully support C++14.

@moneroexamples
Copy link
Owner

yes, its ubuntu 16.04. Same error for me. It works on 18.04 if this is any help as its support of C++14 is much better. I can check later and maybe can refactor the code so it works with older versions of C++ or how to install new C++ compiler on ubuntu 16.04 (e.g. clang-6.0).

@hippich
Copy link
Author

hippich commented Aug 3, 2018

thanks! i will look into installing clang-6 on my machine.

@moneroexamples
Copy link
Owner

moneroexamples commented Aug 4, 2018

You can make it compoile using gcc-8 avaiable in ubuntu-toolchain ppa.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-8 g++-8

Once this is done then compile openmonero using this compiler

cd openmonero/build
# remove old build files if any: rm -rvf .

# make cmake to use gcc-8
export CC=/usr/bin/gcc-8
export CXX=/usr/bin/g++-8
cmake ..
make

Hope this helps.

p.s. no need to upgrade any boost or anything else.

@hippich
Copy link
Author

hippich commented Aug 4, 2018

Thanks! I actually using gcc-7 right now using similar approach. It seems to compile just fine but I am getting same boost linking issues. Researching it now.

@hippich
Copy link
Author

hippich commented Aug 4, 2018

gcc-7 definitely makes errors a bit clearer. still puzzled why it picks up system-wide installed boost's .hpp file when specifying BOOST_ROOT (and cmake seems to identify it correctly). Continue digging...

[ 73%] Linking CXX executable openmonero
src/libmyxrm.a(RPCCalls.cpp.o): In function `boost::this_thread::sleep_for(boost::chrono::duration<long, boost::ratio<1l, 1000000000l> > const&)':
/usr/include/boost/thread/pthread/thread_data.hpp:243: undefined reference to `boost::this_thread::hiden::sleep_for(timespec const&)'
src/libmyxrm.a(RPCCalls.cpp.o): In function `bool boost::regex_search<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)':
/usr/include/boost/regex/v4/regex_search.hpp:56: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find()'
src/libmyxrm.a(RPCCalls.cpp.o): In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)':
/usr/include/boost/regex/v4/perl_matcher.hpp:365: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
collect2: error: ld returned 1 exit status
CMakeFiles/openmonero.dir/build.make:134: recipe for target 'openmonero' failed
make[2]: *** [openmonero] Error 1
CMakeFiles/Makefile2:69: recipe for target 'CMakeFiles/openmonero.dir/all' failed
make[1]: *** [CMakeFiles/openmonero.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

@hippich
Copy link
Author

hippich commented Aug 4, 2018

Yay! Added CPATH manually pointing to my boost installation path and it linked! Thanks for helping!

@hippich hippich closed this as completed Aug 4, 2018
@hippich
Copy link
Author

hippich commented Aug 12, 2018

I am no good at C++ stuff, but to me it looks like it picking up wrong library... Do you have 1.65 installed system-wide? (I installed boost separately, not into system tree, hence all these additional variables I had to define)

@hippich
Copy link
Author

hippich commented Aug 12, 2018

I have no clue... as i said - i am no good at compiling C++ stuff... In case this will help, here is my latest openmonero build script. Keep in mind, i have all dependencies for monero installed in $DEPS folder.

#!/bin/bash

export PROJECT_HOME=/path/to/project/home
export DEPS=$PROJECT_HOME/deps/installed
export MONERO=$PROJECT_HOME/monero

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y
sudo update-alternatives \
    --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \
    --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-7 \
    --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-7 \
    --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-7 \
    --slave /usr/bin/g++ g++ /usr/bin/g++-7

export CFLAGS='-fPIC' CXXFLAGS='-fPIC'

export OPENSSL_ROOT_DIR=$DEPS
export OPENSSL_USE_STATIC_LIBS=TRUE
export BOOST_ROOT=$DEPS DEVELOPER_LOCAL_TOOLS=1
export LIBRARY_PATH=$DEPS/lib:$MONERO/build/release/external/unbound
export CPATH=$DEPS/include:$CPATH

sudo apt install libpcsclite1 libpcsclite-dev libmysql++-dev libcurl3 libcurl3-dev lcov

cd openmonero

rm -rf build
mkdir build
cd build
cmake \
  -DMONERO_DIR=$MONERO \
  -DCMAKE_PREFIX_PATH=$DEPS \
  -Dssl_LIBRARY=$DEPS/lib/libssl.a \
  -Dssl_INCLUDE=$DEPS/include \
  -Dcrypto_LIBRARY=$DEPS/lib/libcrypto.a \
  -DBUILD_SHARED=NO \
  ..
make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@hippich @moneroexamples and others