Path: utzoo!attcan!uunet!cs.utexas.edu!ut-emx!walt.cc.utexas.edu!hdan From: hdan@walt.cc.utexas.edu (Dan Higdon) Newsgroups: comp.lang.c Subject: Re: Helps wanted on Microsoft C compiler. Message-ID: <21795@ut-emx.UUCP> Date: 3 Dec 89 18:51:11 GMT References: <16013@pollux.UUCP> Sender: news@ut-emx.UUCP Reply-To: hdan@walt.cc.utexas.edu (Dan Higdon) Organization: The University of Texas at Austin, Austin, Texas Lines: 31 In article <16013@pollux.UUCP> jwang@smu.edu (Jainbai Wang) writes: >When programming with Microsoft C lately, I run into a problem that the >MSC compiler gives the following error message at compiling time : > > Fatal error C1059 : out of near heap space > >The manual explains it like this : > > The compiler has run out of storage for items that it stores > in the "near" (default data segment) heap. This usually means > that your program has too many symbols or complex expressions. > To correct the problem, divide the file into several smaller > source files, or break expressions into smaller subexpressions. > What is sounds like to me, is not that you are hitting a compiler limit, but rather that you have more than 64k worth of "global scope" data in your source file. The number of symbols defined is probably irrelevant, but their SIZE isn't. The only way I can think of to solve this problem is to find some of the larger elements declared outside of any function and move them into a separate "data" file, recompiling both in Large Model (to allot yorself another segment), and linking them. MSC puts all global data from the same file in the same segment, and you get an error if you have more than 64k in any ONE file, although in Large Model, you can have more than 64k through MULTIPLE FILES. Hope this answers more questions than it causes! hdan@sleepy.cc.utexas.edu (Really Dan Higdon) Any opinions I state must be mine, as I'm not telepathic!