Make Error: sys/dir.h not found

Posted by Imake13 on Sun 15 Jul 2007 07:50 PM — 5 posts, 27,603 views.

USA #0
So I am getting this error when I try to compile my version of Unknown Regions SWR code... thoughts?


John@tri-force /cygdrive/d/mud/ur/src
$ make
make unknown
make[1]: Entering directory `/cygdrive/d/mud/ur/src'
gcc -c -g3 -Wall act_comm.c
gcc -c -g3 -Wall act_info.c
act_info.c: In function `do_password':
act_info.c:3537: warning: implicit declaration of function `crypt'
act_info.c:3537: warning: passing arg 1 of `strcmp' makes pointer from integer w
ithout a cast
act_info.c:3554: warning: assignment makes pointer from integer without a cast
gcc -c -g3 -Wall act_move.c
act_move.c: In function `generate_exit':
act_move.c:550: warning: use of cast expressions as lvalues is deprecated
gcc -c -g3 -Wall act_obj.c
gcc -c -g3 -Wall act_wiz.c
act_wiz.c: In function `do_form_password':
act_wiz.c:4784: warning: implicit declaration of function `crypt'
gcc -c -g3 -Wall boards.c
gcc -c -g3 -Wall build.c
build.c: In function `do_mset':
build.c:1699: warning: implicit declaration of function `crypt'
build.c:1699: warning: assignment makes pointer from integer without a cast
gcc -c -g3 -Wall bounty.c
gcc -c -g3 -Wall ban.c
gcc -c -g3 -Wall clans.c
gcc -c -g3 -Wall comm.c
comm.c: In function `nanny':
comm.c:1580: warning: implicit declaration of function `crypt'
comm.c:1580: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
comm.c:1683: warning: assignment makes pointer from integer without a cast
comm.c:1704: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
gcc -c -g3 -Wall comments.c
gcc -c -g3 -Wall const.c
gcc -c -g3 -Wall councils.c
gcc -c -g3 -Wall db.c
gcc -c -g3 -Wall eng-skills.c
gcc -c -g3 -Wall fight.c
fight.c:39:22: sys/dir.h: No such file or directory
make[1]: *** [fight.o] Error 1
make[1]: Leaving directory `/cygdrive/d/mud/ur/src'
make: *** [all] Error 2
USA #1
If you did a search, you'd find the answer.
http://www.gammon.com.au/forum/bbshowpost.php?id=4699
USA #2
oh duh... thanks


however now I am getting a new error... any ideas?


gcc -c -g3 -Wall smalloc.c
smalloc.c:127: error: conflicting types for 'sbrk'
/usr/include/sys/unistd.h:120: error: previous declaration of 'sbrk' was here
smalloc.c:127: error: conflicting types for 'sbrk'
/usr/include/sys/unistd.h:120: error: previous declaration of 'sbrk' was here
smalloc.c:391: warning: return type defaults to `int'
smalloc.c:417: warning: return type defaults to `int'
make[1]: *** [smalloc.o] Error 1
make[1]: Leaving directory `/cygdrive/d/mud/ur/src'
make: *** [all] Error 2

John@tri-force /cygdrive/d/mud/ur/src




here is the surrounding code:

/*
* nextf[i] is the pointer to the next free block of size 2^(i+3). The
* smallest allocatable block is 8 bytes. The overhead information
* precedes the data area returned to the user.
*/
static union overhead *nextf[NBUCKETS];
extern char *sbrk(); <----- line 127

static int pagesz; /* page size */
static int pagebucket; /* page size bucket */

USA #3
I'm not 100% sure on this, but you could try renaming sbrk (in the MUD code) to something else.
USA #4
Best bet is to ditch the smalloc.c file all together. It no longer serves the need it was created for.