Undefined reference to `argon2i_hash_raw’

we are trying to build a c++ project for which we have been provided a build.sh file. We are getting a linking error as shown below.

66%] Linking CXX executable ../bin/rdiscoveryd
/usr/bin/cmake -E cmake_link_script CMakeFiles/rdiscoveryd.dir/link.txt --verbose=1
g++-7  -Wno-psabi  -rdynamic CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_discoveryd.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_riaps_actor.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_msghandler.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_dhttracker.cc.o CMakeFiles/rdiscoveryd.dir/src/utils/r_lmdb.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_validator.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_dhtdata.cc.o CMakeFiles/rdiscoveryd.dir/include/messaging/disco.capnp.c++.o  -o ../bin/rdiscoveryd  -L/usr/local/lib -Wl,-rpath,/usr/local/lib:/home/ubuntu/Desktop/riaps-core-master/bin: -lczmq -lzmq -lopendht -lgnutls ../bin/libriaps.so -lcapnp -lnettle -lhogweed -lgmp -lpthread -lkj -llmdb -lstdc++fs 
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libopendht.a(crypto.cpp.o): In function `dht::crypto::stretchKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<unsigned char, std::allocator<unsigned char> >&, unsigned long)':
(.text+0x5946): undefined reference to `argon2i_hash_raw'
collect2: error: ld returned 1 exit status
CMakeFiles/rdiscoveryd.dir/build.make:281: recipe for target '../bin/rdiscoveryd' failed
make[2]: *** [../bin/rdiscoveryd] Error 1
make[2]: Leaving directory '/home/ubuntu/Desktop/riaps-core-master/build-amd64'
CMakeFiles/Makefile2:451: recipe for target 'CMakeFiles/rdiscoveryd.dir/all' failed
make[1]: *** [CMakeFiles/rdiscoveryd.dir/all] Error 2
make[1]: Leaving directory '/home/ubuntu/Desktop/riaps-core-master/build-amd64'
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

Source: Windows Questions C++

LEAVE A COMMENT