LINK "Too Many Groups in One Module" with 30+ Named COMMONs (33628)






This article was previously published under Q33628

SYMPTOMS

If a program has more than 30 named COMMON blocks, it will give the following error at LINK time:
fatal error L1050: too many groups in one module
The program runs correctly inside the QuickBasic editor.

In QuickBasic version 3.00, the error message is as follows:
Too many GRPDEFS in one module

STATUS

Microsoft has confirmed this to be a bug in QuickBasic versions 3.00, 4.00, and 4.00b; in Microsoft Basic Compiler versions 6.00 and 6.00b for MS OS/2 and MS-DOS; and in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS OS/2 and MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

LINK.EXE is limited to support only 21 GRPDEF records per .OBJ module; Basic needs to be better optimized to produce a minimum number of GRPDEF records per .OBJ module when using named COMMON blocks. This feature is under review and will be considered for inclusion in a future release.

The following code example duplicates the problem:
   COMMON SHARED /Ann/ a1
   COMMON SHARED /Brent/ a2
   COMMON SHARED /Bill/ a3
   COMMON SHARED /Darren/ a4
   COMMON SHARED /Jeff/ a5
   COMMON SHARED /Jim/ a6
   COMMON SHARED /John/ a7
   COMMON SHARED /Kyle/ a8
   COMMON SHARED /LiKai/ a9
   COMMON SHARED /Michelle/ a10
   COMMON SHARED /Mike1/ a11
   COMMON SHARED /Mike2/ a12
   COMMON SHARED /Nancy1/ a13
   COMMON SHARED /Nancy2/ a14
   COMMON SHARED /Rich/ a15
   COMMON SHARED /Sholeh/ a16
   COMMON SHARED /Teri/ a17
   COMMON SHARED /Terri/ a18
   COMMON SHARED /Terry/ a19
   COMMON SHARED /Todd/ a20
   COMMON SHARED /Tom/ a21
   COMMON SHARED /Greg/ a22
   COMMON SHARED /Ziggy/ a23
   COMMON SHARED /Dudley/ a24
   COMMON SHARED /Beowulf/ a25
   COMMON SHARED /Daffy/ a26
   COMMON SHARED /Yoda/ a27
   COMMON SHARED /Peewee/ a28
   COMMON SHARED /Desslok/ a29
   COMMON SHARED /Mel/ a30
   COMMON SHARED /Harrison/ a31
   PRINT "OK!"
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB33628