Compiling update.cpp

Posted by Ktossell on Sun 03 Feb 2002 04:12 AM — 7 posts, 30,404 views.

USA #0
Hi, i get this error when compiling. There is no setitimer function in all of the code, so I wonder what this is referring to.

c++ -c -Wall -g -O update.cpp -o obj/update.o
update.cpp: In function `void reset_itimer ()':
update.cpp:101: aggregate `itimerval itimer' has incomplete type and
cannot be initialized
update.cpp:109: `setitimer' undeclared (first use this function)
update.cpp:109: (Each undeclared identifier is reported only once for
each function it appears in.)
make: *** [update.o] Error 1

OS: rhl 2.4.17 P3

thanx
Ken
Australia Forum Administrator #1
See Compiling DoT under Cygwin - this mentions an change to update.cpp to work around this problem.
USA #2
yeah. it compiled but now i get this from the linking:

rm -f ../dawn
c++ -g -O -lz -o ../dawn \
obj/act_comm.o obj/act_ente.o obj/act_info.o obj/act_move.o
obj/act_obj.o obj/act_wiz.o obj/act_wiz2.o obj/affects.o obj/alias.o
obj/areas.o obj/autostat.o obj/ban.o obj/banedit.o obj/base64.o obj/bit.o
obj/channels.o obj/chardata.o obj/clan.o obj/class.o obj/colour.o
obj/comm.o obj/const.o obj/corpse.o obj/cust_col.o obj/d2magsys.o obj/db.o
obj/db2.o obj/debug.o obj/deity.o obj/descript.o obj/duel.o obj/dyntable.o
obj/dynamics.o obj/ey_crypt.o obj/effects.o obj/exitlist.o obj/fight.o
obj/flags.o obj/ftp.o obj/gamble.o obj/gio.o obj/global.o obj/grpedit.o
obj/handler.o obj/healer.o obj/help.o obj/hreboot.o obj/ictime.o
obj/immquest.o obj/interp.o obj/intro.o obj/intro_ex.o obj/ispell.o
obj/language.o obj/laston.o obj/letters.o obj/lookup.o obj/magic.o
obj/magic_ce.o obj/magic_da.o obj/magic_ja.o obj/magic_ke.o obj/magic_ob.o
obj/magic_qu.o obj/magic_ra.o obj/magic_re.o obj/magic_ti.o obj/map.o
obj/match.o obj/mem.o obj/mix.o obj/mob_cmds.o obj/mob_prog.o obj/mob_q.o
obj/mount.o obj/msp.o obj/mud2web.o obj/mxp.o obj/namegen.o obj/nanny.o
obj/network.o obj/noble.o obj/note.o obj/notenet.o obj/obdb.o
obj/obskill.o obj/olc.o obj/olc_ex.o obj/o_lookup.o obj/olc_act.o
obj/olc_mpcd.o obj/olc_save.o obj/offmoot.o obj/password.o obj/pipe.o
obj/pload.o obj/races.o obj/recycle.o obj/remort.o obj/resolve.o
obj/roles.o obj/rp.o obj/save.o obj/saymote.o obj/scan.o obj/score.o
obj/skills.o obj/skill_ke.o obj/skill_ti.o obj/sk_type.o obj/socials.o
obj/special.o obj/statset.o obj/string.o obj/support.o obj/scripts.o
obj/tables.o obj/textsrch.o obj/tokens.o obj/track.o obj/trap.o
obj/update.o obj/websrv.o obj/who.o obj/whofmt.o obj/aedit.o obj/cedit.o
obj/clanedit.o obj/comedit.o obj/gameedit.o obj/hedit.o obj/herbedit.o
obj/medit.o obj/mixedit.o obj/oedit.o obj/qedit.o obj/redit.o
obj/raceedit.o obj/sedit.o obj/socedit.o obj/com_time.o
obj/comm.o: In function `update_currenttime(void)':
/home/ruffoloc/mud/src/comm.cpp:84: undefined reference to
`gettimeofday(timeval *, timezone *)'
obj/comm.o: In function `game_loop(void)':
/home/ruffoloc/mud/src/comm.cpp:1013: undefined reference to
`gettimeofday(timeval *, timezone *)'
/home/ruffoloc/mud/src/comm.cpp:1027: undefined reference to
`gettimeofday(timeval *, timezone *)'
/home/ruffoloc/mud/src/comm.cpp:1060: undefined reference to
`gettimeofday(timeval *, timezone *)'
collect2: ld returned 1 exit status
make: *** [dawn] Error 1

USA #3
okay. i got it.

The time function is broken. Just comment out the gettimeofday struct in comm.h and add "#include sys/time.h" to the beginning of comm.cpp
USA #4
Did you make any changes in the source files update.cpp & ictime.cpp/.h?
USA #5
Another note, it sounds like you made some additions to the code (new source files), if you did not modify the makefile.in, it will not recognize your new input.

Go to ../src/configure/ and type rm -fv makefile.cache

Then type ../configure. This will test to see if the system you are running the MUD on has all the necessary information for the code to run properly on.

After you have done this, go to ../src and type make clean. This will remove all your object files and do a full clean compile of your code.

- Daos
USA #6
Disregard the last previous post if you are NOT running Linux for your MUD.