I will demo how to use openssl api to generate the hash.
#include <openssl/evp.h>
// more ITERATIONs, more secure. But you should consider the performance on your target machine
ITERATION = 512000;
// this will be the result of PBKDF2-HMAC-SHA1
int SHA1_LEN = 20;
unsigned char* out = (unsigned char*)calloc(SHA1_LEN, sizeof(unsigned char));
int SALT_LEN = 5;
unsigned char* salt = (unsigned char*)calloc(SALT_LEN, sizeof(unsigned char));
RAND_bytes(salt, SALT_LEN);
pwd = ""; /*your password here */
PKCS5_PBKDF2_HMAC_SHA1(pwd, strlen(pwd), salt_value, SALT_LEN, ITERATION, SHA1_LEN, out);