Thread: Global data

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    5

    Global data

    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

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Which memory model did you choose for your program?

    Try choosing a bigger memory model
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Use the large memory model. It normally clears errors up like the ones you are encountering and ...IMO is the most useful.

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    5
    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.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Sounds like you compiled it as one big source file, and not as separate modules
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Nov 2003
    Posts
    5
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 03:27 AM
  2. data structure design for data aggregation
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 05-20-2008, 06:43 AM
  3. Where's the EPIPE signal?
    By marc.andrysco in forum Networking/Device Communication
    Replies: 0
    Last Post: 12-23-2006, 08:04 PM
  4. C diamonds and perls :°)
    By Carlos in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 05-16-2003, 10:19 PM
  5. to much global data?
    By d00-asu in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 09-10-2001, 12:45 PM