在Eclipse中构建项目的问题

时间:2010-11-18 08:04:38

标签: c eclipse

在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)

此函数在头文件中声明。

你能帮助我吗?

1 个答案:

答案 0 :(得分:1)

海湾合作委员会抱怨struct timezone未申报。在文件中向下几行,它抱怨取消引用指向不完整类型的指针。我怀疑gettimeofday.c:41使用tzp参数。你有struct timezone的声明吗?在我的系统上,它在/usr/include/linux/time.h中声明。