Problem building project in Eclipse
While building a project in Eclipse I got the following output:
make all
Building file: ../Source/gettimeofday.c
Invoking: GCC C Compiler
gcc -I"/root/Desktop/Eclipse/openwsman/Header" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -
MF"Source/gettimeofday.d" -MT"Source/gettimeofday.d" -o"Source/gettimeofday.o" "../Source/gettimeofday.c"
../Source/gettimeofday.c:38: warning: ‘struct timezone’ declared inside parameter list
../Source/gettimeofday.c:38: warning: its scope is only this definition or d开发者_如何学JAVAeclaration, which is probably not
what you want
../Source/gettimeofday.c: In function ‘gettimeofday’:
../Source/gettimeofday.c:41: error: dereferencing pointer to incomplete type
../Source/gettimeofday.c:41: error: dereferencing pointer to incomplete type
make: *** [Source/gettimeofday.o] Error 1
The problematic line is:
int gettimeofday(struct timeval *tv, struct timezone *tzp)
This function is declared in the header file.
Can you help me?
GCC complains that struct timezone
is undeclared. A few lines down in the file it complains about dereferencing a pointer to an incomplete type. I suspect that gettimeofday.c:41
uses the tzp
argument. Did you include a declaration for struct timezone
? On my system, it is declared in /usr/include/linux/time.h
.
精彩评论