Porting an application from VC++1.52 to Borland c++ 4.52

I am porting an application from VC++1.52 to BC++4.52.

My application has about 70-80 programs varying in code size from 0 to 35,000 and data size from 20 to 20,000.  I defined about 9 to 10 Style sheets and carefully associated them with the various source programs, such that none of them would  exceed 64K.

After doing this, still I get the same error "Group DGROUP exceeds 64K". The linker halts at CRTLDLL.lib. Can you help me how to proceed further and remove this link error?
sasikalaAsked:
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.

nietodCommented:
Obviously there is nothing we can do to really help you with this, you need to either trim down your memory usage, switch to a different model (probably not an option) or switch to 32 bit.    And seriously, I would consider that last option!

What memory model are you using?
0
sasikalaAuthor Commented:
I am using "Large Memory model". As far switching to 32-bit option, since its porting of an existing application and porting to 32bit will require rewriting large portions of code (considerable efforts) we have not opted to do that.

On the other hand, is it possible that instead of compiling as a single exe file, we can probably break up into 'n' no.of DLLS. Will it be of any help ?
0
nietodCommented:
Breaking it up into DLLs definitely might help.

But unless this application has a limited lifetime rewritting it is the option to use.  You will probably find that the rewrite is not that bad and the application will certainly improve from it.  Furthermore, if you plan to use the application well into the future, eventually you will have to rewrite it, so do it now.  I would continue to limp along in 16 bit only if you knew for sure that the application will not be needed soon.
0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

AlexVirochovskyCommented:
1.
Add the keyword 'far' to the declaration as in:
int far some_array[100];

This causes the array to be located outside of DGROUP.

Don't forget to alter any header files that also have declarations for the
arrays you
do either of these things to.
2. Check recomendation from
http://www.borland.com/devsupport/bcppbuilder/ti/TI354C.html
3. Use trick:
   place in you project
obj file before cpp file, as
  myprog.obj
  myprog.cpp
Let me know, what happens.
Alex
 
0
sasikalaAuthor Commented:
Hi Alex,
Thanks for your recommendation. I shall check up my code, try your suggestion and get back if I have further queries.

Regards
0
AlexVirochovskyCommented:
Sasi, i hope my advice helps you
(monimum I 've tested 1-st way and it
works).
Alex
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
sasikalaAuthor Commented:
Alex,

Since there are humpty no.of files(*.c,*h), I need to study the dependencies and I am taking time to do this.

Meanwhile I just tried doing this for only one source file say a.c. Wherever there were arrays (char, int or other types), I have changed to far pointers. Still I get the same link error "Group Dgroup exceeds 64K". Also the Map file shows the following errors while compiling the source file a.c.

==> "Group DGROUP overlaps group MMMG4 in library file D:\BC45\LIB\crtldll.lib in module cwd"

==> "Group DGROUP overlaps group MG4 in library file D:\BC45\LIB\crtldll.lib in module cwd"

==> "Group DGROUP overlaps group MGG4 in library file D:\BC45\LIB\crtldll.lib in module cwd"

MMMG4, MG4 and MGG4 are the group names given for data segment, far data segment and code segment which correspond to a new style sheet  associated with the source file a.c.

Any help how I can resolve this error ?

Regards
 
0
nietodCommented:
>> Wherever there were arrays (char, int or other types),
>> I have changed to far pointers
That's not necessarily correct.

The errors you get might occur if some files in the project haven't been recompiled and linked recently.  (I'm guessing.)

Are you sure switching to 32 bit is harder?
0
AlexVirochovskyCommented:
Simple delete all styles.
0
sasikalaAuthor Commented:
Neitod,
1. Its a huge application designed originally for 16bit. Switching to 32bit, we estimated as a massive excercise involving one or two man years. So not planning to do this.

Alex,

Deleting all styles helps me remove the "Overlapping Error". But the original error "Group Dgroup exceeds 64K" still remains.

Regards
 
0
AlexVirochovskyCommented:
have you maked most/all of global data
in all modules far?
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.