Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C Struct - field has incomplete type

In my header file I have this

    typedef struct _client_value
{
    int client_id;
    struct timeval t;
    size_t size;
    char value[0];
} client_value;

I already included <time.h> but when I compiled, it said: field 't' has incomplete type struct timeval t.

I don't understand how this could happen.

like image 583
Huy Doan Avatar asked Oct 24 '25 19:10

Huy Doan


1 Answers

Its #include <sys/time.h>

like image 153
vim_ Avatar answered Oct 28 '25 02:10

vim_