[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 722
  • Last Modified:

Linker Error

Yeah Im having an Application written in 'C' and build under BorlandC++ 3.1. The application is DOS based. When I compile the whole application, Im getting a Linker Error : "Group DGROUP exceeds 64K".
Can anybody let me know how should i can overcome this problem, and can compile and link so that the executable of this application is formed.
0
sajid_k
Asked:
sajid_k
  • 2
  • 2
1 Solution
 
imladrisCommented:
DGROUP is the segment which contains all global and static variables. They are normally confined to a single segment, which, in the Intel world, means a limit of 64K.

The simplest way out of this trap, is to select some number of large variables (large multidimensional arrays?) and allocate them dynamically instead.
0
 
sajid_kAuthor Commented:
I would like to have somewhat more detailed explanations as to how i can overcome this problem.
0
 
imladrisCommented:
Normally speaking, if you need more information, you don't grade the answer yet.


I know nothing about your code. So let me give you an example from situations I encountered.

Originally the program had a large array of strings:

char mitem[1000][17];


This will take up 17K in DGROUP. When DGROUP grew beyond 64K, I made it dynamic. The declaration became:

char (*mitem)[17];

Then space was allocated with:

mitem=calloc(1000,17);

This reduced the consumption in DGROUP from 17K to 4 bytes.
0
 
sajid_kAuthor Commented:
ok, thanks man, i think this will solve my problem.
   I think u should get all the points which are supposed to be for this answer.
0

Featured Post

Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now