# error:storage size of 'XX' isn't known



## foxqoo (Nov 6, 2010)

I meet a strange problem when am writting PRAMON, the struct that I defined in /sys/sys/proc.h can not be used.

For example:

In my file---------- ----/sys/sys/proc.h


```
struct proc   /* old proc struct in proc.h*/
{ ... };
struct fox_test
{ int a; } ;    /**my new defined struct */
```
 
In ------------------------/tmp/test.c


```
#include<fcntl.h>
#include<sys/param.h>
#include<sys/proc.h>
 
struct proc ppc;
 
//struct fox_test ftt;
/* 
//if I add this line above("struct fox_test ftt;"), this file will fall in compile; error:storage size of 'ftt' isn't known
// however , this file could be compiled successfully without "struct fox_test ftt;"
*/
int main()
{
    return 0;
}
```
 

```
>cc ./test.c
>error:storage size of 'ftt' isn't known
```
 

I even try to test this problem in /usr/src/bin/ps
I can define "struct proc ppc;" in ps.c , then I usd make command. It compiles correct. 
But when I add "struct fox_test ftt; ", then I usd make command. It fails with the same error;


But in kern_fork()
I can use fox_test,
I am really frustrated with this problem.
Can you just tell me what cause this kind of problem ?

thanks,

Ye


----------

