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

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

 



Hello,
I have to define a structure : login_handle, in loginh.h. I defined it like this :
--------------code-----------------------------------
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 :

--------------code------------------------------------
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,
Aro


Partagez vos souvenirs sur le Web avec les personnes de votre choix les personnes de votre choix.
_______________________________________________
Pam-list mailing list
Pam-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/pam-list

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

  Powered by Linux