I am trying to get a password hashing library that I found to work on a VM that I am hosting an API on. You can find the library here: http://ift.tt/2rOlmDC
I managed to set this up and get it running by following the instructions on the library page, just fine, however I am following the same steps on my VM running Ubuntu 16.04 and can't for the life of me get any file containing the library to compile.
Compile command (note that I installed g++ on the Ubuntu VM):
g++ --std=c++11 -lbcrypt main.cpp
Output
/tmp/ccCeYXhe.o: In function BCrypt::generateHash(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<cha
r> > const&, int)':
main.cpp:(.text._ZN6BCrypt12generateHashERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi[_ZN6BCrypt12generateHashERKNS
t7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi]+0x44): undefined reference to `bcrypt_gensalt'
main.cpp:(.text._ZN6BCrypt12generateHashERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi[_ZN6BCrypt12generateHashERKNS
t7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi]+0xa7): undefined reference to `bcrypt_hashpw'
/tmp/ccCeYXhe.o: In function `BCrypt::validatePassword(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator
<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
main.cpp:(.text._ZN6BCrypt16validatePasswordERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_[_ZN6BCrypt16validatePas
swordERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_]+0x33): undefined reference to `bcrypt_checkpw'
collect2: error: ld returned 1 exit status
Any ideas are apprecaited.
Aucun commentaire:
Enregistrer un commentaire