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

Build error - develop branch / Windows 10 / VS 2019 / Boost 1.70 #1735

Closed
3 tasks
jmjatlanta opened this issue Apr 25, 2019 · 9 comments
Closed
3 tasks

Build error - develop branch / Windows 10 / VS 2019 / Boost 1.70 #1735

jmjatlanta opened this issue Apr 25, 2019 · 9 comments
Labels
4a Low Priority Priority indicating minimal impact to system/user -OR- an inexpensive workaround exists 6 Build Impact flag identifying the build process

Comments

@jmjatlanta
Copy link
Contributor

Below is an error I receive when attempting to build BitShares-Core on Windows 10 using Visual Studio 2019 / Boost 1.70 / OpenSSL 1.1.1b

I am suspecting this is due to recent changes in fc, or perhaps Boost. I have not thoroughly researched. However, I do know I previously built with Visual Studio 2019 but with Boost 1.69 compiled with Visual Studio 2017.

Microsoft (R) Build Engine version 16.0.461+g6ff56ef63c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

secp256k1.vcxproj -> C:\Development\cpp\bitshares-core\libraries\fc\Release\secp256k1.lib
websocket.cpp
C:\Development\cpp\bitshares-core\libraries\fc\include\fc/variant.hpp(656): warning C4101: 'e': unreferenced local vari
able [C:\Development\cpp\bitshares-core\libraries\fc\fc.vcxproj]
C:\Development\cpp\bitshares-core\libraries\fc\vendor\websocketpp\websocketpp/frame.hpp(831): warning C4267: '=': conve
rsion from 'size_t' to 'uint32_t', possible loss of data [C:\Development\cpp\bitshares-core\libraries\fc\fc.vcxproj]
C:\Development\cpp\bitshares-core\libraries\fc\vendor\websocketpp\websocketpp/transport/asio/security/none.hpp(250): wa
rning C4996: 'boost::asio::basic_socket<Protocol,Executor>::cancel': By default, this function always fails with operat
ion_not_supported when used on Windows XP, Windows Server 2003, or earlier. Consult documentation for details. [C:\Deve
lopment\cpp\bitshares-core\libraries\fc\fc.vcxproj]
with
[
Protocol=boost::asio::ip::tcp,
Executor=boost::asio::executor
]
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/basic_socket.hpp(693): note: see declaration of 'boost::asi
o::basic_socket<Protocol,Executor>::cancel'
with
[
Protocol=boost::asio::ip::tcp,
Executor=boost::asio::executor
]
C:\Development\cpp\bitshares-core\libraries\fc\vendor\websocketpp\websocketpp/transport/asio/security/tls.hpp(324): war
ning C4996: 'boost::asio::basic_socket<Protocol,Executor>::cancel': By default, this function always fails with operati
on_not_supported when used on Windows XP, Windows Server 2003, or earlier. Consult documentation for details. [C:\Devel
opment\cpp\bitshares-core\libraries\fc\fc.vcxproj]
with
[
Protocol=boost::asio::ip::tcp,
Executor=boost::asio::executor
]
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/basic_socket.hpp(693): note: see declaration of 'boost::asi
o::basic_socket<Protocol,Executor>::cancel'
with
[
Protocol=boost::asio::ip::tcp,
Executor=boost::asio::executor
]
C:\Development\cpp\bitshares-core\libraries\fc\vendor\websocketpp\websocketpp/common/md5.hpp(367): warning C4267: '+=':
conversion from 'size_t' to 'websocketpp::md5::md5_word_t', possible loss of data [C:\Development\cpp\bitshares-core\l
ibraries\fc\fc.vcxproj]
C:\Development\cpp\bitshares-core\libraries\fc\vendor\websocketpp\websocketpp/sha1/sha1.hpp(176): warning C4267: '=': c
onversion from 'size_t' to 'unsigned int', possible loss of data [C:\Development\cpp\bitshares-core\libraries\fc\fc.vcx
proj]
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/impl/executor.hpp(218): error C2678: binary '==': no operator
found which takes a left-hand operand of type 'const Executor' (or there is no acceptable conversion) [C:\Development
cpp\bitshares-core\libraries\fc\fc.vcxproj]
with
[
Executor=std::reference_wrapperboost::asio::io_service
]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\exception(284): note:
could be 'bool std::operator ==(const std::exception_ptr &,const std::exception_ptr &) noexcept' [found using argume
nt-dependent lookup]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\exception(288): note:
or 'bool std::operator ==(std::nullptr_t,const std::exception_ptr &) noexcept' [found using argument-dependent
lookup]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\exception(292): note:
or 'bool std::operator ==(const std::exception_ptr &,std::nullptr_t) noexcept' [found using argument-dependent
lookup]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\system_error(217): no
te: or 'bool std::operator ==(const std::error_code &,const std::error_code &) noexcept' [found using argument-
dependent lookup]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\system_error(222): no
te: or 'bool std::operator ==(const std::error_code &,const std::error_condition &) noexcept' [found using argu
ment-dependent lookup]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\system_error(227): no
te: or 'bool std::operator ==(const std::error_condition &,const std::error_code &) noexcept' [found using argu
ment-dependent lookup]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\system_error(232): no
te: or 'bool std::operator ==(const std::error_condition &,const std::error_condition &) noexcept' [found using
argument-dependent lookup]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\thread(198): note: or
'bool std::operator ==(std::thread::id,std::thread::id) noexcept' [found using argument-dependent lookup]
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/detail/io_object_executor.hpp(137): note: or 'bool bo
ost::asio::detail::io_object_executor::operator ==(const boost::asio::detail::io_object_executor
&,const boost::asio::detail::io_object_executor &) noexcept' [found using argument-dependent lookup]
with
[
Executor=boost::asio::executor
]
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/impl/executor.hpp(218): note: while trying to match the arg
ument list '(const Executor, const Executor)'
with
[
Executor=std::reference_wrapperboost::asio::io_service
]
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/impl/executor.hpp(213): note: while compiling class templat
e member function 'bool boost::asio::executor::impl<Executor,std::allocator>::equals(const boost::asio::executo
r::impl_base *) noexcept const'
with
[
Executor=std::reference_wrapperboost::asio::io_service
]
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/impl/executor.hpp(333): note: see reference to class templa
te instantiation 'boost::asio::executor::impl<Executor,std::allocator>' being compiled
with
[
Executor=std::reference_wrapperboost::asio::io_service
]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\memory(1547): note: s
ee reference to function template instantiation 'boost::asio::executor::executor<_Ty>(Executor)' being compiled
with
[
_Ty=std::reference_wrapperboost::asio::io_service,
Executor=std::reference_wrapperboost::asio::io_service
]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\memory(1602): note: s
ee reference to function template instantiation 'std::_Ref_count_obj<_Ty>::_Ref_count_obj<std::reference_wrapper>(std::reference_wrapperboost::asio::io_service &&)' being compiled
with
[
_Ty=boost::asio::ip::tcp::socket
]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\memory(1602): note: s
ee reference to function template instantiation 'std::_Ref_count_obj<_Ty>::_Ref_count_obj<std::reference_wrapper>(std::reference_wrapperboost::asio::io_service &&)' being compiled
with
[
_Ty=boost::asio::ip::tcp::socket
]
C:\Development\cpp\bitshares-core\libraries\fc\vendor\websocketpp\websocketpp/transport/asio/security/none.hpp(172):
note: see reference to function template instantiation 'std::shared_ptr<websocketpp::transport::asio::basic_socket::c
onnection::socket_type> std::make_shared<boost::asio::ip::tcp::socket,std::reference_wrapperboost::asio::io_service

(std::reference_wrapperboost::asio::io_service &&)' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/use_future.hpp(139): note: see reference to class template
instantiation 'boost::asio::use_future_t<std::allocator>::std_allocator_void' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/asio/use_future.hpp(147): note: see reference to class template
instantiation 'boost::asio::use_future_t<std::allocator>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(54): note: see reference to class template
instantiation 'boost::arg<9>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(53): note: see reference to class template
instantiation 'boost::arg<8>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(52): note: see reference to class template
instantiation 'boost::arg<7>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(51): note: see reference to class template
instantiation 'boost::arg<6>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(50): note: see reference to class template
instantiation 'boost::arg<5>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(49): note: see reference to class template
instantiation 'boost::arg<4>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(48): note: see reference to class template
instantiation 'boost::arg<3>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(47): note: see reference to class template
instantiation 'boost::arg<2>' being compiled
C:\Development\cpp\boost170\include\boost-1_70\boost/bind/placeholders.hpp(46): note: see reference to class template
instantiation 'boost::arg<1>' being compiled

Build Environment

  • Host OS: Windows 10
  • Host Physical RAM 8GB
  • Source Branch/Tag: develop
  • OpenSSL Version: 1.1.1b
  • Boost Version: 1.70
  • C++ Compiler: Visual Studio 16 2019 x64

Steps To Reproduce
clone repository
cmake -G "Visual Studio 16 2019" -A x64 -DBOOST_ROOT=c:\Development\cpp\boost170 -DCURL_STATICLIB=ON -DCURL_LIBRARY="C:\Program Files\CURL\lib\libcurl_imp.lib" -DCURL_INCLUDE_DIR="C:\Program Files\CURL\include" -DOPENSSL_CONF_SOURCE="C:\Program Files\Common Files\SSL\openssl.cnf"
cmake --build . --target install --config Release

CORE TEAM TASK LIST

  • Evaluate Build Error
  • Provide build guidance
  • Create Bug Report
@jmjatlanta jmjatlanta added the 4a Low Priority Priority indicating minimal impact to system/user -OR- an inexpensive workaround exists label Apr 25, 2019
@pmconrad
Copy link
Contributor

Can't build with boost-1.70 on linux either. Building with Boost_USE_STATIC_LIBS=OFF (like I usually do) fails during cmake, building with Boost_USE_STATIC_LIBS=ON fails with linker errors.

Apparently boost-1.70 installs its own cmake files now, which prevent building a static library (like fc) that links to shared boost libraries. Linking fails due to -lpthread missing, and if I add that it fails due to various unresolved boost symbols.

@pmconrad pmconrad added this to the Future Feature Release milestone Apr 26, 2019
@pmconrad pmconrad added the 6 Build Impact flag identifying the build process label Apr 26, 2019
@pmconrad
Copy link
Contributor

Part of my problems might originate from our rather old included FindBoost and/or an old cmake version (I have 3.10). https://stackoverflow.com/questions/42123509/cmake-finds-boost-but-the-imported-targets-not-available-for-boost-version

@abitmore
Copy link
Member

Is this related? steemit/steem#160 (comment)

@pmconrad
Copy link
Contributor

I don't think so, except perhaps in the general sense that old boost versions sometimes have problems with newer compilers and vice versa.

@jmjatlanta
Copy link
Contributor Author

jmjatlanta commented Apr 30, 2019

I have verified that Boost 1.70 also causes problems with BitShares Core and Visual Studio 2017.

Boost 1.69 cannot be compiled with Visual Studio 2019, so I compiled it (and bitshares-core) with the error above no longer appearing. This verifies that the problem is solely due to Boost 1.70.

The error seems to point to the websocketpp stuff, so I will investigate that area next.

@flameOnYou
Copy link

我已经证实Boost 1.70也会导致BitShares Core和Visual Studio 2017出现问题。

Boost 1.69无法使用Visual Studio 2019编译,所以我编译它(和bitshares-core),上面的错误不再出现。这证实问题仅归因于Boost 1.70。

错误似乎指向websocketpp的东西,所以我接下来将调查该区域。

I use websocketpp and boost1.70 append this error

@jmjatlanta
Copy link
Contributor Author

jmjatlanta commented May 20, 2019

Here is the related issue with websocketpp zaphoyd/websocketpp#794

In short, that project used a deprecated call in boost asio that was removed in Boost 1.70. The suggested fix is to replace calls to make_shared with .reset. They are trying to hang on to the ::ref stuff to maintain c++03 compatibility. More details in the link above and its related PRs.

@abitmore
Copy link
Member

abitmore commented Aug 1, 2019

@pmconrad
Copy link
Contributor

FC has been bumped in #1789, this includes the websocketpp fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4a Low Priority Priority indicating minimal impact to system/user -OR- an inexpensive workaround exists 6 Build Impact flag identifying the build process
Projects
None yet
Development

No branches or pull requests

4 participants