Answer the question
In order to leave comments, you need to log in
Scrypt - C++ | Cryptography library from litecoin?
Greetings. How to include in the project scrypt in the project?
I use IDE, CLion (it uses cmake in due time).
If you just include scrypt.h in the project, there will be errors when linking:
/opt/clion/bin/cmake/bin/cmake --build /home/continue/.CLion2016.1/system/cmake/generated/untitled-ee2b67a2/ee2b67a2/Debug --target untitled -- -j 8
Scanning dependencies of target untitled
[ 50%] Building CXX object CMakeFiles/untitled.dir/main.cpp.o
[100%] Linking CXX executable untitled
CMakeFiles/untitled.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x28): undefined reference to `scrypt_1024_1_1_256(char const*, char*)'
collect2: error: ld returned 1 exit status
CMakeFiles/untitled.dir/build.make:94: ошибка выполнения рецепта для цели «untitled»
gmake[3]: *** [untitled] Ошибка 1
CMakeFiles/Makefile2:67: ошибка выполнения рецепта для цели «CMakeFiles/untitled.dir/all»
gmake[2]: *** [CMakeFiles/untitled.dir/all] Ошибка 2
CMakeFiles/Makefile2:79: ошибка выполнения рецепта для цели «CMakeFiles/untitled.dir/rule»
gmake[1]: *** [CMakeFiles/untitled.dir/rule] Ошибка 2
Makefile:118: ошибка выполнения рецепта для цели «untitled»
gmake: *** [untitled] Ошибка 2
Answer the question
In order to leave comments, you need to log in
In order to connect something that is not header only (in this case, either), it needs to be assembled or downloaded in assembled form. Then add the desired directory with headers to CMakeLists using include_directories, and add linker flags, for example, using target_link_libraries. Read the CMake docs for details.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question