[comp.sys.amiga.tech] Large code

S.J.Raybould@fulcrum.bt.co.uk (Simon Raybould) (09/06/90)

When I try to link a larg program > 300K together with lattice C V5.05,
I get Relative address >32768 or something like that to _GfxBase.

I am compiling with -b0

I have tried making the struct GfxBase *GfxBase line near with the __near
keyword.

I pressume this is because lc.lib was compiled without -b0.

What can I do ??

SJR

dn0o+@andrew.cmu.edu (Derek Brooks Noonburg) (09/07/90)

> Excerpts from netnews.comp.sys.amiga.tech: 6-Sep-90 Large code Simon
> Raybould@fulcrum.b (332)


> When I try to link a larg program > 300K together with lattice C V5.05,
> I get Relative address >32768 or something like that to _GfxBase.

> I am compiling with -b0

> I pressume this is because lc.lib was compiled without -b0.

You should be linking with lcnb.lib (lc.lib compiled with -b0)  If you
compile with the -L switch this gets done automatically, but if you do
the link yourself you have to remember to do it.

- Derek

=========================================================================
=
Derek Noonburg                | ARPA:   dn0o+@andrew.cmu.edu
Senior - Computer Engineering | BITNET: dn0o+@andrew /
dn0o+%andrew@cmccvb
Carnegie Mellon University    | UUCP:   ...harvard!andrew.cmu.edu!dn0o+
    USMail: Box 4175; 5125 Margaret Morrison St.; Pittsburgh, PA 15213
=========================================================================
=

dillon@overload.Berkeley.CA.US (Matthew Dillon) (09/08/90)

In article <DC'%S+-@masalla.fulcrum.bt.co.uk> S.J.Raybould@fulcrum.bt.co.uk (Simon Raybould) writes:
>
>When I try to link a larg program > 300K together with lattice C V5.05,
>I get Relative address >32768 or something like that to _GfxBase.
>
>I am compiling with -b0
>
>I have tried making the struct GfxBase *GfxBase line near with the __near
>keyword.
>
>I pressume this is because lc.lib was compiled without -b0.
>
>What can I do ??
>
>SJR

    You are declaring more than 64KBytes of data.  Assuming you still want
    to retain small-data model accesses for most variables, simply use
    the __far keyword to take some of your larger data declarations
    outside the small-data-model section.

    Then, when you blink, do not use the SD (small-data) keyword.

    e.g.

    char __far BigAry[80000];

    Remember that any other module that uses BigAry[] MUST extern it as
    __far.

				    -Matt
--


    Matthew Dillon	    dillon@Overload.Berkeley.CA.US
    891 Regal Rd.	    uunet.uu.net!overload!dillon
    Berkeley, Ca. 94708
    USA

ggk@tirith.UUCP (Gregory Kritsch) (09/13/90)

>When I try to link a larg program > 300K together with lattice C V5.05,
>I get Relative address >32768 or something like that to _GfxBase.
>
>I am compiling with -b0
>
>I have tried making the struct GfxBase *GfxBase line near with the __near
>keyword.
>
>I pressume this is because lc.lib was compiled without -b0.
>
>What can I do ??

Easiest solution here would be to use lcnb.lib, which WAS compiled with
-b0 on.  Yet another poorly documented feature... there are several
.lib files included with LC 5.0x, for all the different modes available.
There is about 1 page of info on them, lost somewhere in the first
section of the manual.

---
  Gregory Kritsch
    Fido:  1:221/208.11110  [1:163/109.30]
    UUCP:  xenitec!tirith!ggk