Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C v6.0 - Stack plus data exceed 64K

1 view
Skip to first unread message

Alex

unread,
Dec 8, 1997, 3:00:00 AM12/8/97
to

Could someone please help me ?

I've expanded an existing program and am getting the error L2041 when it
tries to link :

stack plus data exceed 64K.

I'm using the /AL /Od /G2 "cl" options, and have tried the different /Ax
options with no luck.

The "link" options are /SE:500 /NOD /NOE /NOI /STACK:5500, and have also
increased both /SE and /STACK, again with no luck.

Unfortunately I'm stuck using Microsoft C v. 6.0 in the DOS environment
with a "Cscape" GUI.

Does anyone have a solution to this problem, besides removing my
changes.

Thanks,

Alex.

Peter Shaggy Haywood

unread,
Dec 15, 1997, 3:00:00 AM12/15/97
to

Groovy hepcat Alex was jivin' on Mon, 08 Dec 1997 11:53:34 +1100 in
comp.programming.
C v6.0 - Stack plus data exceed 64K's a cool scene! Dig it!

>I've expanded an existing program and am getting the error L2041 when it
>tries to link :

This error number is platform specific. This is meaningless to
people who use other compilers.

> stack plus data exceed 64K.

But this is a very common problem beginners encounter.
This is a DOS segmented memory architecture problem. You seem to be,
if I'm not mistaken, targetting small data memory model (tiny, small
or medium memory model). In one of these memory models, there must be
only one data segment, and the stack must be within that same segment.
You need to increase the memory model to compact or larger.

>I'm using the /AL /Od /G2 "cl" options, and have tried the different /Ax
>options with no luck.
>The "link" options are /SE:500 /NOD /NOE /NOI /STACK:5500, and have also

All this stuff is very platform specific. We who use diferent
platforms don't know what these options do.

>increased both /SE and /STACK, again with no luck.

Increasing the stack will only make it worse! More stack space
(remember, it is within the data segment) means less space for data.
Decreasing the stack may help (not guaranteed), but may cause some
other problems.

>Unfortunately I'm stuck using Microsoft C v. 6.0 in the DOS environment
>with a "Cscape" GUI.

That means nothing to me.

>Does anyone have a solution to this problem, besides removing my
>changes.

Well, as I said, you should change memory models. Use a large data
model. This allows multiple data segments and a separate stack
segment.


----- Dig the EVEN NEWER, MORE IMPROVED news sig!! -----

-------------- Shaggy was here! ---------------
http://aardvark.apana.org.au/~phaywood/
============= Ain't I'm a dawg!! ==============


0 new messages