can't link with libecryptfs-dev

Asked by cj

I am trying to write own wrapper function with ecryptfs lib, so i installed the libecryptfs-dev, but some how when I try to link with the lib, it is always getting
main.cpp:(.text+0x66): undefined reference to `from_hex(char*, char*, int)'
main.cpp:(.text+0x84): undefined reference to `ecryptfs_add_passphrase_key_to_keyring(char*, char*, char*)'

the main function is simply copy one of the test program now;

#include <errno.h>
#include <stdio.h>
#include <ecryptfs.h>

int main(int argc, char *argv[])
{
 char auth_tok_sig_hex[ECRYPTFS_SIG_SIZE_HEX + 1];
 char salt[ECRYPTFS_SALT_SIZE + 1];
 int rc;

 if (argc != 3) {
  fprintf(stderr, "%s PASSPHRASE SALT_HEX\n", argv[0]);
  return EINVAL;
 }

 from_hex(salt, argv[2], ECRYPTFS_SALT_SIZE);
 rc = ecryptfs_add_passphrase_key_to_keyring(auth_tok_sig_hex, argv[1],
          salt);
 /* If the key is already added to the keyring, 1 is returned */
 if (rc == 1)
  rc = 0;
 if (!rc)
  printf("%s\n", auth_tok_sig_hex);

 return rc;
}

cj@cjudev-oncamdev-com:~/mount2$ gcc main.cpp -lecryptfs
/tmp/cc9Lq2Ii.o: In function `main':
main.cpp:(.text+0x66): undefined reference to `from_hex(char*, char*, int)'
main.cpp:(.text+0x84): undefined reference to `ecryptfs_add_passphrase_key_to_keyring(char*, char*, char*)'
collect2: error: ld returned 1 exit status

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu ecryptfs-utils Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.