We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am working on a c++ project and included libscrypt-kdf but when linking it throws an error.
I included the header file as follows in my project:
#ifdef __cplusplus extern "C" { #endif #include <string.h> #include "scrypt-kdf.h" #ifdef __cplusplus } #endif
Here is also my hashPassword function:
`int hashPassword(const char* password, const char* salt, uint8_t hashedPasswordOutput[]) { int exitCode = scrypt_kdf((const uint8_t*)password, strlen(password), (const uint8_t*)salt, strlen(salt), N, r, p, hashedPasswordOutput, OUTPUT_BUFLEN);
return exitCode;
}`
And finally, here is the error being thrown:
/usr/bin/ld: CMakeFiles/hello_crow.dir/main.cpp.o: in function hashPassword(char const*, char const*, unsigned char*)': main.cpp:(.text+0x1a0e): undefined reference to crypto_scrypt' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/hello_crow.dir/build.make:88: hello_crow] Error 1 make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/hello_crow.dir/all] Error 2 make: *** [Makefile:84: all] Error 2
/usr/bin/ld: CMakeFiles/hello_crow.dir/main.cpp.o: in function
crypto_scrypt' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/hello_crow.dir/build.make:88: hello_crow] Error 1 make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/hello_crow.dir/all] Error 2 make: *** [Makefile:84: all] Error 2
Here is a screenshot of the error:
Kindly help please. Thanks.
The text was updated successfully, but these errors were encountered:
Sounds like you're not linking to the dynamic library. I don't use CMake so I don't know what the syntax you need for this is.
Sorry, something went wrong.
I was able to resolve it. I included this in my CMakeLists.txt file.
target_link_libraries(scrypt-kdf)
Thanks.
No branches or pull requests
I am working on a c++ project and included libscrypt-kdf but when linking it throws an error.
I included the header file as follows in my project:
#ifdef __cplusplus extern "C" { #endif #include <string.h> #include "scrypt-kdf.h" #ifdef __cplusplus } #endif
Here is also my hashPassword function:
`int hashPassword(const char* password, const char* salt, uint8_t hashedPasswordOutput[]) {
int exitCode = scrypt_kdf((const uint8_t*)password, strlen(password),
(const uint8_t*)salt, strlen(salt), N, r, p, hashedPasswordOutput, OUTPUT_BUFLEN);
}`
And finally, here is the error being thrown:
/usr/bin/ld: CMakeFiles/hello_crow.dir/main.cpp.o: in function
hashPassword(char const*, char const*, unsigned char*)':main.cpp:(.text+0x1a0e): undefined reference to
crypto_scrypt' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/hello_crow.dir/build.make:88: hello_crow] Error 1 make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/hello_crow.dir/all] Error 2 make: *** [Makefile:84: all] Error 2
Here is a screenshot of the error:
Kindly help please. Thanks.
The text was updated successfully, but these errors were encountered: