Thread: Too Much Global Data!!!!

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    10

    Too Much Global Data!!!!

    Ok, I've been working on this RPG for a long time now, and I keep getting the error, 'Too much global data', no matter what I do. I've tried several things to limit my data. For each screen in the game, I have a matrix with integers standing for different terrain, and I used to have a huge three-dimensional array with all this data. Now, however, I have made a screen class and made each screen an instance of that class. It still tells me I have too much global data, even though I have none! Could anyone tell me different criteria that could cause this error?

  2. #2
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    You should probably put your terrain maps into files and load them when the program starts or as needed.

    As for addressing the error directly, it's probably something to do with how you load the data into your screen class instances.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Lemme guess, you're using Turbo C, or some other ancient fossil compiler right?
    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.

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    10
    Quote Originally Posted by Salem View Post
    Lemme guess, you're using Turbo C, or some other ancient fossil compiler right?
    Yep, even older. Borland C++ 5.02. It's what I have right now and I don't got loads of money to buy a new one, they're expensive.

    I have already tried the file option. The point is that the data is stored in a class and other functions. It is not global, so what could cause the compiler to think it is global?

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Yep, even older. Borland C++ 5.02. It's what I have right now and I don't got loads of money to buy a new one, they're expensive.
    The MinGW port of g++ is available at zero price and works with a number of free IDEs including Code Blocks, Dev-C++, and Netbeans.

    Alternatively, Microsoft Visual C++ 2005 and 2008 IDEs can be downloaded and used for free as Express versions, without restriction on the licensing of programs that you develop with them.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > It is not global, so what could cause the compiler to think it is global?
    It could be static, or initialisation data as well. It doesn't make a difference to the real low level stuff. It all takes up space, and due to your compiler, you're stuck with those tiny 64K limits.

    Now there are ways around this, but it's rather like rearranging the deck chairs on the Titanic.

    As for compilers, the world is awash with good quality free compilers, which are perfectly adequate for all student/hobby needs.
    http://www.thefreecountry.com/compilers/cpp.shtml

    You only really need spend $ when you're going to be getting $ in return for your efforts. Even then, it's not compulsory.
    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.

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