lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


At 12:01 PM 9/2/99 , you wrote:
>I guess I did not secribe my problem.  Here is the code I am trying to
>compile:
>#include <stdio.h>
>#include "lua.h"

>void main()
>{
> lua_dofile("hello.lua");
>}

>I set the project memory model to huge and get an error stating that my
>_TEXT segment is larger than 64k.  Am I just out of luck?

Welcome to the wonderful world of 64KB segment limits.  It has been a very
long time since I've worked with DOS (over 7 years), but let me see if I
can dredge up some memories (although mine will be Borland 3.1 experience,
not 4.5).

First, if your memory model is huge, I'm confused as to why you have a
_TEXT segment.  IIRC you should have segments in the line of FILENAME_TEXT
-- one per .OBJ file.  You may want to double-check your compiler settings
on this one.  Perhaps not all of your files share the same settings.

If your files are, in fact, all being compiled huge (I'd go "large" myself
unless you have individual data items over 64KB), the next thing to check
is the code sizes of your various output .OBJs.  If any single .OBJ file
has a generated code segment larger than 64KB, you'll have to split that
file up into two separate files.  This means that any file-static or global
variables have to have their declarations altered accordingly.

Speaking of static or global variables, I think there are some settings you
may have to alter to get them into their own segment.  I don't remember
where they go by default (_BSS perhaps?), but if they're being altered to
go to _TEXT, that may be your problem.  You'll have to mess around with
declarations to get them to weigh in at under 64KB per segment.  There are
#pragma statements to this effect buried deep in the documentation.

Sorry I couldn't be much more help.

--
Michael T. Richter    <mtr@ottawa.com>    http://www.igs.net/~mtr/
          PGP Key: http://www.igs.net/~mtr/pgp-key.html
PGP Fingerprint: 40D1 33E0 F70B 6BB5 8353 4669 B4CC DD09 04ED 4FE8