PDA

View Full Version : Global data



ognjenmi
11-01-2003, 06:50 PM
I'am writing program in Borland Turbo C 3.0 environment for DOS. When I compile every module separately it is compiled without errors, but when I try to link them I got the error message "Too much global data defined". I checked all globals, calculated space needed for all literals and I have no static variabiles. All of them occupies 7KB of memory, but compiler says that it exceeds 64KB. Also i have checked the option "Duplicated strings merged"
Is there any solution for this with this compiler exept writing the database with textual messages for the program (because it willtake much time to change the code of every printf or puts in every module. )
I'm very greatfull for any help

Salem
11-02-2003, 01:18 AM
Which memory model did you choose for your program?

Try choosing a bigger memory model

VirtualAce
11-02-2003, 08:57 AM
Use the large memory model. It normally clears errors up like the ones you are encountering and ...IMO is the most useful.

ognjenmi
11-02-2003, 07:04 PM
I tried large and Huge memory models, but linker always says that _TEXT Segmet occupies 92KB of memory wich is imposible because all my source code has 122KB and just 6KB of text.

Salem
11-03-2003, 01:49 AM
Sounds like you compiled it as one big source file, and not as separate modules

ognjenmi
11-03-2003, 06:28 PM
I've solved the problem. I've mistaken because i didn't use project manager and compiler understood all this like one big source file.

Thanks for all help.