UUID broken with Boost 1.67 and VS2015?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

UUID broken with Boost 1.67 and VS2015?

Boost - Dev mailing list
In a source file including:

#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid_generators.hpp>

and then calling

boost::uuids::to_string(boost::uuids::random_generator()())

I'm getting:

[15/26] Linking CXX executable test\ome-files\ometiffwriter.exe
FAILED: test/ome-files/ometiffwriter.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E
vs_link_exe --intdir=test\ome-files\CMakeFiles\ometiffwriter.dir
--manifests  -- C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe /nologo
test\ome-files\CMakeFiles\ometiffwriter.dir\ometiffwriter.cpp.obj
test\ome-files\CMakeFiles\ometiffwriter.dir\tiffsamples.cpp.obj  
/out:test\ome-files\ometiffwriter.exe
/implib:test\ome-files\ometiffwriter.lib
/pdb:test\ome-files\ometiffwriter.pdb /version:0.0  /machine:x64
/debug /INCREMENTAL /subsystem:console  lib\ome\files\ome-filesd.lib
lib\ome\test\ome-testd.lib C:\build\b\stage\lib\ome-xmld.lib
C:\build\b\stage\lib\boost_random-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\tiffd.lib C:\build\b\stage\lib\ome-commond.lib
C:\build\b\stage\lib\boost_iostreams-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_log-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_filesystem-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_regex-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_log_setup-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_thread-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_date_time-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_chrono-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_system-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_atomic-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\Xalan-C_1D.lib C:\build\b\stage\lib\xerces-c_3D.lib
C:\build\b\tools\lib\gtest.lib kernel32.lib user32.lib gdi32.lib
winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib
advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe
/nologo
test\ome-files\CMakeFiles\ometiffwriter.dir\ometiffwriter.cpp.obj
test\ome-files\CMakeFiles\ometiffwriter.dir\tiffsamples.cpp.obj
/out:test\ome-files\ometiffwriter.exe
/implib:test\ome-files\ometiffwriter.lib
/pdb:test\ome-files\ometiffwriter.pdb /version:0.0 /machine:x64 /debug
/INCREMENTAL /subsystem:console lib\ome\files\ome-filesd.lib
lib\ome\test\ome-testd.lib C:\build\b\stage\lib\ome-xmld.lib
C:\build\b\stage\lib\boost_random-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\tiffd.lib C:\build\b\stage\lib\ome-commond.lib
C:\build\b\stage\lib\boost_iostreams-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_log-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_filesystem-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_regex-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_log_setup-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_thread-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_date_time-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_chrono-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_system-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\boost_atomic-vc140-mt-gd-x64-1_67.lib
C:\build\b\stage\lib\Xalan-C_1D.lib C:\build\b\stage\lib\xerces-c_3D.lib
C:\build\b\tools\lib\gtest.lib kernel32.lib user32.lib gdi32.lib
winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib
advapi32.lib /MANIFEST
/MANIFESTFILE:test\ome-files\CMakeFiles\ometiffwriter.dir/intermediate.manifest
test\ome-files\CMakeFiles\ometiffwriter.dir/manifest.res" failed (exit
code 1120) with the following output:
    Creating library test\ome-files\ometiffwriter.lib and object
test\ome-files\ometiffwriter.exp
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
Reply | Threaded
Open this post in threaded view
|

Re: UUID broken with Boost 1.67 and VS2015?

Boost - Dev mailing list

> 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).aspx

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


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: UUID broken with Boost 1.67 and VS2015?

Boost - Dev mailing list
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).aspx 
>
> Maybe you need to link to bcrypt.lib?  Hopefully this is documented
> somewhere...

It is - on the very page you linked.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: UUID broken with Boost 1.67 and VS2015?

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On Mon, Apr 23, 2018 at 12:43 PM, Roger Leigh via Boost <
[hidden email]> wrote:

> In a source file including:
>
> #include <boost/uuid/uuid.hpp>
> #include <boost/uuid/uuid_io.hpp>
> #include <boost/uuid/uuid_generators.hpp>
>
> 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
>

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: UUID broken with Boost 1.67 and VS2015?

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On Mon, Apr 23, 2018 at 12:43 PM, Roger Leigh via Boost <
[hidden email]> wrote:

> In a source file including:
>
> #include <boost/uuid/uuid.hpp>
> #include <boost/uuid/uuid_io.hpp>
> #include <boost/uuid/uuid_generators.hpp>
>
> 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/random_provider_bcrypt.ipp#L17

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/random_provider_detect_platform.hpp#L28

Thanks,

Jim

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost