2014-01-13 20 views
0

Может ли кто-нибудь помочь мне с этой ошибкой? Что не так?Тип массива имеет неполный тип элемента для struct iocb

[[email protected] tests]$ cat iocbtst.c 
#include <libaio.h> 

struct iovec     fsb_iovecs[1]; 

main() { 

    struct iovec *iovec_ptrs[1]; 

    iovec_ptrs[0]=&fsb_iovecs[0]; 

} 
[[email protected] tests]$ gcc -c iocbtst.c 
iocbtst.c:3:30: error: array type has incomplete element type 
struct iovec     fsb_iovecs[1]; 
          ^
[[email protected] tests]$ 
[[email protected] tests]$ rpm -qa|grep libaio 
libaio-devel-0.3.109-7.fc19.x86_64 
libaio-debuginfo-0.3.109-7.fc19.x86_64 
libaio-0.3.109-7.fc19.x86_64 
[[email protected] tests]$ 

Это с Fedora 19, ядро ​​3.12.5-200.fc19.x86_64

[[email protected] tests]$ grep -A 15 struct\ iocb\ { /usr/include/libaio.h 
struct iocb { 
    PADDEDptr(void *data, __pad1); /* Return in the io completion event */ 
    PADDED(unsigned key, __pad2); /* For use in identifying io requests */ 

    short  aio_lio_opcode; 
    short  aio_reqprio; 
    int  aio_fildes; 

    union { 
     struct io_iocb_common  c; 
     struct io_iocb_vector  v; 
     struct io_iocb_poll  poll; 
     struct io_iocb_sockaddr saddr; 
    } u; 
}; 

[[email protected] tests]$ 

ответ

2
iocbtst.c:3:30: error: array type has incomplete element type 
struct iovec     fsb_iovecs[1]; 

Я думаю, что он жалуется из-за iovec. Попробуйте включить <sys/uio.h>.

Смежные вопросы