0

I have one problem with library <bcrypt.h>. Compiler say error with function bcrypt_gensalt.

#include <iostream>
#include <bcrypt.h>

using namespace std;

int main() {

    const char* passwd = "Secret_Password";

    char results[BCRYPT_HASHSIZE];

    bcrypt_gensalt(10, results);

    system("pause");
    return 0;
}

Error from compiler:

unresolved external symbol bcrypt_gensalt referenced in function main
jww
  • 97,681
  • 90
  • 411
  • 885
  • Add `#pragma comment (lib, "bcrypt.lib")` to the source file outside of `main`. – jww Aug 19 '19 at 09:47

1 Answers1

0

You need to reference Bcrypt.lib.

See here: http://msdn.microsoft.com/en-us/library/ba1z7822.aspx.

Ken Wong
  • 16
  • 2