Compiling Problem with Dev C++

Posted by BLaZe on Sun 30 Mar 2003 07:25 PM — 3 posts, 15,162 views.

#0
When I try to build the exe file I get the following error(I saw this error on a previous post but it was with a diffrent OS and a diffrent compiler)
I am running XP with the DevC++ compiler:



src/comm.c:2856: conflicting types for `gettimeofday'




Here's the complete log:




Compiler: Default compiler
Building Makefile: "C:\starterMUD stock\Makefile.win"
Executing make...
make.exe -f "C:\starterMUD stock\Makefile.win" all
gcc.exe -c src/comm.c -o src/comm.o -I"C:/Dev-Cpp/include" -D__GNUWIN32__ -W -DWIN32 -DNDEBUG -D_CONSOLE -D_MBCS -O3

In file included from src/comm.c:67:
src/merc.h:2158: warning: `struct timezone' declared inside parameter list
src/merc.h:2158: warning: its scope is only this definition or declaration, which is probably not what you want

src/comm.c: In function `game_loop_unix':
src/comm.c:805: warning: comparison between signed and unsigned
src/comm.c:806: warning: comparison between signed and unsigned
src/comm.c:828: warning: comparison between signed and unsigned

src/comm.c: In function `read_from_descriptor':
src/comm.c:1154: warning: comparison between signed and unsigned

src/comm.c: In function `check_parse_name':
src/comm.c:2366: warning: comparison between signed and unsigned

src/comm.c: At top level:
src/comm.c:2855: warning: `struct timezone' declared inside parameter list
src/comm.c:2856: conflicting types for `gettimeofday'
src/merc.h:2158: previous declaration of `gettimeofday'

make.exe: *** [src/comm.o] Error 1

Execution terminated



Has any1 else using this compiler had this problem or can any1 give me a solution to it?
Australia Forum Administrator #1
The problems with the time.h include file seem to crop up from time to time, excuse the pun.

I'm not sure exactly how to fix this, as I don't have that compiler, but I would look up the help files to find where timezone is declared, and include that file.

For instance, at the top of comm.c, add the line:

#include <sys/time.h>

or whatever the appropriate file is.
#2
I had this problem also, using both DJGPP and whatever comes with Cygwin (not very experienced with Cygwin... just got it to see if it would fix the problem.) I tried including a direct path to time.h as "#include <sys/time.h>"
was already in comm.c... Any more ideas? Blaze did you ever figure out your problem?