aed@netcom.UUCP (Andrew Davidson) (01/05/91)
hi I am currently trying to port tcl ( a public domain command line interperter, it is designed to be embeded in applications) from the BSD universe to System 5.3. (it runs on a SUN work station but won`t compile on SCO unix) The first set of errors are related to the following line #include <stdio.h> #include <errno.h> #include <pwd.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/dir.h> #include <sys/stat.h> #include <tcl.h> DIR *d; line 263 struct direct *entryPtr; entryPtr = readdir(d); line 292 cc -g -I. -DTCL_VERSION=\"3.3\" -c tclGlob.c tclGlob.c tclGlob.c(263) : error C2065: 'DIR' : undefined tclGlob.c(263) : error C2065: 'd' : undefined I discovered that DIR was defined in /usr/include/dirent.h. Adding this header file and recompiling got me cc -g -I. -DSCO -DTCL_VERSION=\"3.3\" -c tclGlob.c tclGlob.c tclGlob.c(292) : warning C4049: '=' : indirection to different types tclGlob.c(308) : error C2038: 'd_namlen' : not struct/union member tclGlob.c(310) : error C2038: 'd_namlen' : not struct/union member tclGlob.c(313) : error C2038: 'd_namlen' : not struct/union member so I took a look at my man pages for readdir() and found it to be defined as struct dirent *readdir( dirp ) DIR *dirp I did a little snooping around and found the following in /usr/include/sys/ndir.h extern struct direct *readdir(); I though this would do the trick but including this header file go me cc -g -I. -DSCO -DTCL_VERSION=\"3.3\" -c tclGlob.c tclGlob.c /usr/include/sys/ndir.h(45) : warning C4005: 'MAXNAMLEN' : redefinition /usr/include/sys/ndir.h(47) : error C2025: 'direct' : enum/struct/union type redefinition /usr/include/sys/ndir.h(73) : error C2122: typedef specifies different struct /usr/include/sys/ndir.h(78) : error C2086: 'readdir' : redefinition /usr/include/sys/ndir.h(81) : warning C4005: 'rewinddir' : redefinition I tried compiling with just the ndir.h file (not dirent.h) and got cc -g -I. -DSCO -DTCL_VERSION=\"3.3\" -c tclGlob.c tclGlob.c /usr/include/sys/ndir.h(47) : error C2025: 'direct' : enum/struct/union type redefinition I am also having trouble with wait(), but it is in a non-essential cunk of code Any Ideas? andy -- ----------------------------------------------------------------- "bede-bede-bede Thats all Folks" Porky Pig Andy Davidson Woodside CA. aed@netcom -----------------------------------------------------------------