1 year ago

#151610

test-img

Willy

How to link Bcrypt.lib to VC++ DLL project

Trying to compile a VC++ DLL I get some error messages related to Visual Studio cannot resolve external symbols, errors LNK2001, LNK1120.

In my case the symbol it cannot be resolved is: __imp__BCryptGenRandom@16

and the error message is:

error LNK2001: unresolved external symbol __imp__BCryptGenRandom@16

I have googled and found that it is said to link BCrypt.lib so I have linked it at "properties->linker->input->additional dependency"

Also at ""properties->linker->all options->additional library directoris" I have added below one where BCrypt.lib is for x86:

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86

And finally at "properties->linker->General->Use library dependencies inputs" I have set "Yes".

But none of these methods work.

visual-c++

visual-studio-2019

bcrypt

lnk2001

bcrypt.net

0 Answers

Your Answer

Accepted video resources