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.
>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!! ==============