UUID broken with Boost 1.67 and VS2015?
In a source file including:
#include
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?
Those API's are part of the Windows API, see https://msdn.microsoft.com/en-us/library/windows/desktop/aa375377(v=vs.85).a... Maybe you need to link to bcrypt.lib? Hopefully this is documented somewhere... HTH, John. --- This email has been checked for viruses by AVG. http://www.avg.com
On 04/23/18 20:08, John Maddock via Boost wrote:
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?
Those API's are part of the Windows API, see https://msdn.microsoft.com/en-us/library/windows/desktop/aa375377(v=vs.85).a...
Maybe you need to link to bcrypt.lib? Hopefully this is documented somewhere...
It is - on the very page you linked.
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_provider_base::~random_provider_base(void)" (??1random_provider_base@detail@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
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman /listinfo.cgi/boost
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
participants (4)
-
Andrey Semashev
-
James E. King, III
-
John Maddock
-
rleigh@codelibre.net