Helps wanted on Microsoft C compiler.

Dan Higdon hdan at walt.cc.utexas.edu
Mon Dec 4 05:51:11 AEST 1989


In article <16013 at pollux.UUCP> jwang at 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 at sleepy.cc.utexas.edu (Really Dan Higdon)
Any opinions I state must be mine, as I'm not telepathic!



More information about the Comp.lang.c mailing list