From: <no...@so...> - 2002-07-31 12:49:46
|
Bugs item #583571, was opened at 2002-07-18 23:24 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=583571&group_id=12694 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Dana Kaempen (kaempen) Assigned to: Nobody/Anonymous (nobody) Summary: Compile errors on SCO OpenServer 5.0.5 Initial Comment: I'm trying to compile net-snmp-5.0.2.pre1 on SCO OpenServer 5.0.5, but am getting halted quite early due to two undeclared variables (error lines from the make output): system.c: In function `get_boottime': system.c:591: `L_SET' undeclared (first use in this function) system.c:591: (Each undeclared identifier is reported only once system.c:591: for each function it appears in.) system.c: In function `mkdirhier': system.c:833: `MAXPATHLEN' undeclared (first use in this function) *** Error code 1 (bu21) *** Error code 1 (bu21) The first error, L_SET, refers to the last field in the function lseek. I only see one line in /usr/include/unistd.h which refers to lseek and this is it: extern off_t lseek(int, off_t, int); Under AIX 4.3.3, where it also won't compile but gets past system.c, there are two definitions for lseek, but they're ifdef'd separately: extern off_t lseek(); extern off_t lseek(int, off_t, int); The other error, the MAXPATHLEN, is a bit easier to understand. The error is generated on this line: char buf[SNMP_MAXPATH]; I'm guessing that the value of SNMP_MAXPATH is MAXPATHLEN, since there's no actual reference to MAXPATHLEN in system.c. SNMP_MAXPATH is only used 3 times in system.c, and not in any other program. The other 2 times it's used in system.c are commented out - therefore, it's undefined. This is as far as I'm capable of diagnosing these problems. I'm not a C coder, so I don't know the proper way to fix either of the issues above. I have two separate directories, one where I'm using gcc as the compiler, the other using cc. Both give the same errors (I used the gcc errors here because they're slightly more verbose). Any thoughts or help in moving forward would be appreciated. Thank you! ---------------------------------------------------------------------- >Comment By: Dave Shield (dts12) Date: 2002-07-31 13:49 Message: Logged In: YES user_id=88893 Errr... no, that wasn't the right solution. We can't really ask people to change the system header files just for this package. The first thing to do is to check whether L_SET is defined somewhere else. Try cd /usr/include find . -type f -print |xargs grep L_SET and if that doesn't throw anything up, try with SEEK_SET. (That might be a better token to use anyway, judging by the 'lseek' man page). As far as the MAXPATHLEN stuff's concerned, the patch was: --- tools.h 20 Apr 2002 07:30:12 -0000 5.0 +++ tools.h 19 Jul 2002 11:04:07 -0000 5.1 @@ -20,7 +20,11 @@ # ifdef PATH_MAX # define SNMP_MAXPATH PATH_MAX # else -# define SNMP_MAXPATH MAXPATHLEN +# ifdef MAXPATHLEN +# define SNMP_MAXPATH MAXPATHLEN +# else +# define SNMP_MAXPATH 1024 +# endif # endif #endif and should be included in the next release. ---------------------------------------------------------------------- Comment By: Dana Kaempen (kaempen) Date: 2002-07-30 17:08 Message: Logged In: YES user_id=580512 Dave - Thanks for the pointing me to the "official" location of L_SET - on this version of SCO, there was nothing defined for L_SET, so I grabbed the three lines from a Solaris system and modified <sys/file.h> - I'll give it a shot as soon as I can get the updated source code. Speaking of which... How can I get a copy of your MAXPATHLEN changes? The distributed source doesn't appear to have been updated and I didn't see anything under 'patches,' either. At wits' end, would you send them to me? My email is below (remove the anti-spam letters): decay@NO_BOTSflash.net Thank you for your help. Dana ---------------------------------------------------------------------- Comment By: Dave Shield (dts12) Date: 2002-07-30 15:57 Message: Logged In: YES user_id=88893 I've tweaked the code to default to a sensible value if MAXPATHLEN (or similar) can't be found. The L_SET problem is a bit harder to fix. Can you check your system header files to see where it might be defined, please? I'd typically expect to see this in <sys/file.h> That might help track down why you're not seeing it here. Dave ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=583571&group_id=12694 |