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

Aro RANAIVONDRAMBOLA razuki at hotmail.fr
Wed Aug 19 11:45:12 UTC 2009


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.
http://www.microsoft.com/northafrica/windows/windowslive/products/photos-share.aspx?tab=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pam-list/attachments/20090819/d36fad8c/attachment.htm>


More information about the Pam-list mailing list