invalid application of ‘sizeof’ to incomplete type ‘struct pam_handle’

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


I have to define a structure : login_handle, in loginh.h. I defined it like this :
typedef struct pam_handle pam_handle_t;
typedef struct login_handle login_handle_t;

struct login_handle{
  unsigned int use_lp;
  unsigned int use_sc;
  pam_handle_t *login_pamh;

in pam_pkcs11.c, I allocate memory :

login_handle_t *lh;
lh->login_pamh = (pam_handle_t *)malloc(sizeof(struct pam_handle));

and I get error :
invalid application of ‘sizeof’ to incomplete type ‘struct pam_handle’

My question :
- I think the compiler says that because pam_handle is not defined anywhere ... isn't it ?
- How should I use pam_handle ? should I include some files in my loginh.h file, before defining struct login_handle ? If I should, what file exactly ? ( the file which defines pam_handle is hidden ... (private) according to the doc).
- Is there another reason why I get error ?

thanks for your help,

Partagez vos souvenirs sur le Web avec les personnes de votre choix les personnes de votre choix.
Pam-list mailing list

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux