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

invalid application of ‘sizeof’ to incomple te type ‘struct pam_handle’



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.

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