problem mit timeval in struct
-
Hallo,
scheinbar habe ich Tomaten auf den Augen. Irgendwie find ich nicht den Fehler und gcc verweigert das Kompilieren.
#include <time.h> ... typedef struct PValue { int b_value; unsigned u_value; int i_value; double f_value; char s_value[MSG_LEN]; PType type; timeval date; } PValue; ...
der gcc gibt folgende meldung raus:
... src/parameter/struct.h:36: error: syntax error before "timeval" src/parameter/struct.h:36: warning: no semicolon at end of struct or union src/parameter/struct.h:37: warning: type defaults to `int' in declaration of `PValue' src/parameter/struct.h:37: warning: data definition has no type or storage class ...
Der Fehler tritt nur auf, wenn ich
timeval date;
hinzufüge, ansonsten funz es. Sieht jemand den fehler? ich bin am rande der verzweifelung.
Gruß,
tyr377
-
Du programmierst C?
typedef struct PValue { int b_value; unsigned u_value; int i_value; double f_value; char s_value[MSG_LEN]; PType type; struct timeval date; } PValue;
-
Ja, und dazu kommt C++. Musste ne C-Lib wrappen, damit ich sie in C++ nutzen konnte. Mit dem struct gehts nun und ist auch schon klar. C brauches und in C++ kann ich's weg lassen. Danke schön.
Gruß,
tyr377