在Eclipse中构建项目时,我得到了以下输出:
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 declaration, 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有问题的一行是:
int gettimeofday(struct timeval *tv, struct timezone *tzp)此函数在头文件中声明。
你能帮帮我吗?
发布于 2010-11-21 04:17:37
GCC吐槽struct timezone未申报在文件中的几行以下,它会报告取消对指向不完整类型的指针的引用。我怀疑gettimeofday.c:41使用了tzp参数。您是否包含了struct timezone的声明?在我的系统上,它是用/usr/include/linux/time.h声明的。
https://stackoverflow.com/questions/4212741
复制相似问题