• C

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.
sajid_kAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.