HUGE causes linker error 
Author Message
 HUGE causes linker error

I have a book on DOS extenders.  Just starting out, it demonstrates the
problems you can get creating and running a file that uses more memory than
DOS can access.  The short C listing used for the demo appears below.
I'm using Microsoft C/C++ version 7.0 (vintage 1991).  I'm using the LARGE
model for compiling (as instructed).

Without the 'HUGE' modifier in my array definition, it simply tells me my
array is > 64k (as expected).
When I use HUGE, it gives a kind of errors I didn't expect (see snip of
PWB's 'Build Results' included below). The errors indicate references are
being made that refer to things that aren't defined.  It needs LLIBCE.LIB,
but I can find no such file available in my software.  Maybe PWB is changing
something being passed to the linker.  I would
dispense with PWB and work from the command line, however the 'Build
Results' information is not recorded anywhere unless I use PWB, hence I
cannot even see the errors unless I use PWB.
 I HAVE TWO QUESTIONS:
1)  what can I do about the LLIBCE problem ?
2)  how canI get the error info without using PWB ?

Microsoft (R) Segmented Executable Linker  Version 5.30
Object Modules [.obj]: .\BIG.obj
Run File [BIG.exe]: .\BIG.exe
List File [nul.map]: NUL
Libraries [.lib]:  +
Libraries [.lib]:  +
Libraries [.lib]:
Definitions File [nul.def]:  /NOI /BATCH /ONERROR:NOEXE /EXE /FAR /PACKC;
LINK : warning L4051: LLIBCE.lib : cannot find library
LINK : warning L4021: no stack segment

.\BIG.obj(big.c) : error L2029: '__aFlmul' : unresolved external
.\BIG.obj(big.c) : error L2029: '__AHSHIFT' : unresolved external
.\BIG.obj(big.c) : error L2029: '__acrtused' : unresolved external
.\BIG.obj(big.c) : error L2029: '_printf' : unresolved external

NMAKE : fatal error U1077: 'LINK' : return code '2'
Stop.

/*big.c*/
#include <stdlib.h>
#include <stdio.h>
#define     SIZE    512
static long huge  array[SIZE][SIZE];
/* static long   __huge  array[SIZE][SIZE]; /*
/* static long array[SIZE][SIZE]; */

main()
{
   int i,j;
   printf("Using %lu-byte array\n",
   (long) SIZE * SIZE * sizeof(long));
   for (i=0; i < SIZE; i++)
   {
 for (j=0; j < SIZE; j++)
     array[i][j] = (long) i * j;
     printf("%d\r", i);
   }
   printf("done\n");
   return 0;

Quote:
}



Thu, 07 Aug 2003 20:01:09 GMT  
 HUGE causes linker error


Quote:
> I have a book on DOS extenders.  Just starting out, it demonstrates the
> problems you can get creating and running a file that uses more memory
than
> DOS can access.  The short C listing used for the demo appears below.
> I'm using Microsoft C/C++ version 7.0 (vintage 1991).  I'm using the LARGE
> model for compiling (as instructed).

> Without the 'HUGE' modifier in my array definition, it simply tells me my
> array is > 64k (as expected).
> When I use HUGE, it gives a kind of errors I didn't expect (see snip of
> PWB's 'Build Results' included below). The errors indicate references are
> being made that refer to things that aren't defined.  It needs LLIBCE.LIB,
> but I can find no such file available in my software.  Maybe PWB is
changing
> something being passed to the linker.  I would
> dispense with PWB and work from the command line, however the 'Build
> Results' information is not recorded anywhere unless I use PWB, hence I
> cannot even see the errors unless I use PWB.
>  I HAVE TWO QUESTIONS:
> 1)  what can I do about the LLIBCE problem ?
> 2)  how canI get the error info without using PWB ?

> Microsoft (R) Segmented Executable Linker  Version 5.30
> Object Modules [.obj]: .\BIG.obj
> Run File [BIG.exe]: .\BIG.exe
> List File [nul.map]: NUL
> Libraries [.lib]:  +
> Libraries [.lib]:  +
> Libraries [.lib]:
> Definitions File [nul.def]:  /NOI /BATCH /ONERROR:NOEXE /EXE /FAR /PACKC;
> LINK : warning L4051: LLIBCE.lib : cannot find library
> LINK : warning L4021: no stack segment

> .\BIG.obj(big.c) : error L2029: '__aFlmul' : unresolved external
> .\BIG.obj(big.c) : error L2029: '__AHSHIFT' : unresolved external
> .\BIG.obj(big.c) : error L2029: '__acrtused' : unresolved external
> .\BIG.obj(big.c) : error L2029: '_printf' : unresolved external

> NMAKE : fatal error U1077: 'LINK' : return code '2'
> Stop.

> /*big.c*/
> #include <stdlib.h>
> #include <stdio.h>
> #define     SIZE    512
> static long huge  array[SIZE][SIZE];
> /* static long   __huge  array[SIZE][SIZE]; /*
> /* static long array[SIZE][SIZE]; */

> main()
> {
>    int i,j;
>    printf("Using %lu-byte array\n",
>    (long) SIZE * SIZE * sizeof(long));
>    for (i=0; i < SIZE; i++)
>    {
>  for (j=0; j < SIZE; j++)
>      array[i][j] = (long) i * j;
>      printf("%d\r", i);
>    }
>    printf("done\n");
>    return 0;
> }



Thu, 07 Aug 2003 22:19:36 GMT  
 HUGE causes linker error

Quote:

> I have a book on DOS extenders.

The compiler obviously needs to link special code to accomodate the "huge"
extension and you haven't set it up to link this correctly.

Unfortunately the solution to the problem is very platform-specific and
beyond the scope of this ng, which deals only with the C language proper.



Thu, 07 Aug 2003 22:22:05 GMT  
 HUGE causes linker error

Quote:
> Unfortunately the solution to the problem is very platform-specific and
> beyond the scope of this ng, which deals only with the C language proper.

This software is kind of old.  Can you suggest a good newsgroup for this
post ?


Fri, 08 Aug 2003 21:27:05 GMT  
 HUGE causes linker error


Quote:
>I have a book on DOS extenders.

Unfortunatemy DOS extends are very platform (i.e. DOS) specific, they
have no relevance to the topic of this newsgroup which is the (standard)
C language. I.e. we talk about C language issues that are relevant to
all C platforms, not specific ones. For that you need a relevant
platform-specific newsgroup. For DOS comp.os.msdos.programmer is
appropriate.

Quote:
> Just starting out, it demonstrates the
>problems you can get creating and running a file that uses more memory than
>DOS can access.  The short C listing used for the demo appears below.
>I'm using Microsoft C/C++ version 7.0 (vintage 1991).  I'm using the LARGE
>model for compiling (as instructed).

>Without the 'HUGE' modifier in my array definition, it simply tells me my
>array is > 64k (as expected).

Things like "memory model" and "huge" don't exist in the C language per se,
but only on particular platforms and/or compilers. Even under the same OS
different compilers may not support thiese things in the same way. Again,
I suggest you try conmp.os.msdos.programmer. Since you are using a
microsoft compiler you might find a suitable newsgroup in the
microsoft.public.* hierarchy.

--
-----------------------------------------


-----------------------------------------



Fri, 08 Aug 2003 23:07:25 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. using _variant_t rather than _bstr_t causing linker error LNK2005

2. ADO property causes linker error

3. Enabling Exception handling causes Linker error, help!

4. pure virtual destructor causes linker error

5. Large Causing Problem, Huge is OK

6. MSFlexGrid causes rc file to get huge

7. Message maps causes linker problems

8. linker error again: unusual fatal error LNK1104

9. linker error 2001/compiler error 2893(templates and friend clases involved)

10. Linker Error : Internal Error on Pass2

11. Turbo C++ 1.0 Huge pointer addition error?

12. Huge rounding errors when converting floats to doubles

 

 
Powered by phpBB® Forum Software