Проблемное построение проекта в Eclipse - PullRequest
0 голосов
/ 18 ноября 2010

При создании проекта в 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 Ответ

1 голос
/ 20 ноября 2010

GCC жалуется, что struct timezone не объявлено.Несколько строк внизу файла жалуются на разыменование указателя на неполный тип.Я подозреваю, что gettimeofday.c:41 использует аргумент tzp.Вы включили декларацию для struct timezone?В моей системе он объявлен в /usr/include/linux/time.h.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...