On Mon, Apr 23, 2018 at 12:43 PM, Roger Leigh via Boost < boost@lists.boost.org> wrote:
In a source file including:
#include
#include #include and then calling
boost::uuids::to_string(boost::uuids::random_generator()())
I'm getting:
ome-filesd.lib(OMETIFFWriter.cpp.obj) : error LNK2019: unresolved external symbol BCryptCloseAlgorithmProvider referenced in function "public: __cdecl boost::uuids::detail::random_p rovider_base::~random_provider_base(void)" (??1random_provider_base@detai l@uuids@boost@@QEAA@XZ) ome-filesd.lib(OMETIFFWriter.cpp.obj) : error LNK2019: unresolved external symbol BCryptGenRandom referenced in function "public: void __cdecl boost::uuids::detail::random_provider_base::get_random_bytes(void *,unsigned __int64)" (?get_random_bytes@random_provider_base@detail @uuids@boost@@QEAAXPEAX_K@Z) ome-filesd.lib(OMETIFFWriter.cpp.obj) : error LNK2019: unresolved external symbol BCryptOpenAlgorithmProvider referenced in function "public: __cdecl boost::uuids::detail::random_provider_base::random_provider_base(void)" (??0random_provider_base@detail@uuids@boost@@QEAA@XZ) test\ome-files\ometiffwriter.exe : fatal error LNK1120: 3 unresolved externals
Looking at boost/winapi/bcrypt.hpp from the 1.67.0 source tar.bz2, I see these symbols prototyped, but not defined anywhere. Is this header broken, missing the implementation?
Thanks, Roger
As of 1.67.0, for uuid consumers, the default entropy provider on Windows is bcrypt. The bcrypt library is included automatically unless you are defining BOOST_ALL_NO_LIB or BOOST_UUID_RANDOM_PROVIDER_NO_LIB. See: https://github.com/boostorg/uuid/blob/develop/include/boost/uuid/detail/rand... If you want to continue to use wincrypt then you can either define BOOST_UUID_RANDOM_PROVIDER_FORCE_WINCRYPT or set _WIN32_WINNT to something less than 0x0600. The entropy provider logic happens at compile time. See: https://github.com/boostorg/uuid/blob/develop/include/boost/uuid/detail/rand... Thanks, Jim