Vix
Vix

Reputation: 21

MINGW64 cannot find reference to libcrypt

I have problem with building my C++ project using CLion, MINGw64. So this is the problem I cannot handle with ._. Everything works on Linux but on Win10 I have this log:

libBiblioteka.a(Rent.cpp.obj): In function `boost::uuids::detail::random_provider_base::random_provider_base()':
C:/msys64/mingw64/include/boost/uuid/detail/random_provider_bcrypt.ipp:40: undefined reference to `BCryptOpenAlgorithmProvider'
libBiblioteka.a(Rent.cpp.obj): In function `boost::uuids::detail::random_provider_base::get_random_bytes(void*, unsigned long long)':
C:/msys64/mingw64/include/boost/uuid/detail/random_provider_bcrypt.ipp:76: undefined reference to `BCryptGenRandom'
libBiblioteka.a(Rent.cpp.obj): In function `boost::uuids::detail::random_provider_base::destroy()':
C:/msys64/mingw64/include/boost/uuid/detail/random_provider_bcrypt.ipp:93: undefined reference to `BCryptCloseAlgorithmProvider'
collect2.exe: error: ld returned 1 exit status

I have read these references are unavaiable on win10. But there is an question: Is there any way to workaround this?

Upvotes: 2

Views: 3613

Answers (1)

Brecht Sanders
Brecht Sanders

Reputation: 7305

Those are not defined in libcrypt but in libbcrypt. Did you have the same typo in your linker flags (you should have -lbcrypt)?

Upvotes: 4

Related Questions