Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!decuac!hadron!dkp From: dkp@hadron.UUCP (David K. Purks) Newsgroups: comp.sources.d Subject: Re: Nethack and Microsoft C 4.0 Message-ID: <610@hadron.UUCP> Date: Fri, 7-Aug-87 10:26:15 EDT Article-I.D.: hadron.610 Posted: Fri Aug 7 10:26:15 1987 Date-Received: Sun, 9-Aug-87 00:47:39 EDT References: <165@bernina.UUCP> Reply-To: dkp@hadron.UUCP (David K. Purks) Organization: Hadron, Inc., Fairfax, VA Lines: 65 Keywords: Bummer, segment size, link, huh? In article <165@bernina.UUCP> srp@ethz.UUCP (Scott Presnell) writes: >Hello, > I've got a problem compiling and linking nethack under MSC 4.0 on >a stock AT (all hack options defined). Take a gander... > . . . >>Run File [DECL.EXE]: HACK.EXE /NOIG /STACK:6000; >>Segment size exceeds 64K >>Input File: MSDOS.OBJ(msdos.c) pos: 9A Record type: 98 >>*** Error code 149 > >I'm not sure I understand the meaning of that error in the context of a >large model program. I am certain that all modules were compiled with the >large model option switch. I'm bummed :-(. Anyone got any clues? > >Also there is apparently some bug in makedefs which trashes the first two >lines in onames.h so that I must add back in the lines defining the >AMULET_OF_YENDOR and a STRANGE_OBJECT. > First, the problem with makedefs appears to be a very strange problem with Microsoft version 4.0. When you do an freopen() using "w+" for stdout, the first two lines of output get thrown away. The easiest portable way to fix it is to: #ifdef MSDOS #define FILEMODE "w" #else #define FILEMODE "w+" #endif and then to globally change the "w+" to be FILEMODE. There is another problem with makedefs in this environment. The rename() calls fail because the old file name still exists. For each rename() call do: #ifdef MSDOS remove(oldfile); #endif rename(newfile,oldfile); Scott pointed out something that I missed...that the problem with the first two lines was what was causing some of my symbols to disappear (namely AMULET_OF_YENDOR). To solve the problem of the segment being too big, recompile all the modules with the -Gt switch. I've set it to 100 (-Gt100) and it compiles and links correctly (other than the fact that it says _dothrow, _getcomspec, _setty, and _uptodate are undefined...I haven't had a chance to look into these yet). I had serious problems with the makefile & make.ini as distributed (I'm using NDMAKE version 3.8, not the one supplied with MSC v4.0). Let's hope we can get this compiled and running soon. If you do, be sure to keep Mike Stephenson (seismo!mnetor!genat!mike) posted of the mods you had to make so we can all have the most up to date version. Dave Purks