# error: dereferencing pointer to incomplete type



## liuwang (Nov 12, 2011)

Appreciate any help to resolve the following compiling error. Liu

Compiling Error:

```
main.c: In function 'AOC_pci_request_regions':
main.c:>>>: error: dereferencing pointer to incomplete type
main.c:>>>: error: dereferencing pointer to incomplete type
```

Source Code:

```
static int AOC_pci_request_regions( device_t dev, const char *res_name )
{
int i,j;
int rid;
int bar;
struct resource_list_entry *rle;
struct pci_devinfo *dinfo;
struct resource_list *rl;

for ( i = 0; i <= PCIR_MAX_BAR_0; i++ ) 
{
bar = PCIR_BAR( i );
dinfo = device_get_ivars( dev );
>>> rl = &dinfo->resources;
rle = resource_list_find(rl,SYS_RES_MEMORY,i);
if( rle == NULL )
{
dinfo = device_get_ivars(dev);
>>> rl = &dinfo->resources;
rle=resource_list_find(rl,SYS_RES_IOPORT, i);
};

if( rle == NULL )
return (-ENODEV);
};
â€¦
}
```


----------



## xibo (Nov 14, 2011)

You most probably forgot to include some headers.


----------



## liuwang (Nov 14, 2011)

xibo,

Thanks.

Do you know where struct resource_list is defined? I searched the whole /usr/src and could not locate it.

Sincerely,
Liu


----------



## jrm@ (Nov 14, 2011)

I don't know anything about this, but from

`% grep -ir "resource_list" /usr/include`

I see:


```
./machine/nexusvar.h:   struct resource_list    nx_resources;
```


----------



## liuwang (Nov 14, 2011)

jrm,

Thanks.

Yes, nx_resources is declared as struct resource_list" The structure resource_list looks defined no where.

Sincerely,
Liu


----------

