Thread: warning LNK4084 ???????

  1. #1
    NoClue
    Guest

    warning LNK4084 ???????

    hey im making a simple 2d sprite game using a single buffer, and an algorithm which loads the levels from bitmap to an object array, it all works fine on windows me but returns the warning:

    warning LNK4084: total image size 832401408 exceeds max (268435456);

    i have just re-installed windows xp and now when i try to run my same app it doesnt run due to this causing a win32 error,
    i have checked to see if the composite value of images does exceed 256mb(on the off chance it did) but nope it was only 9.6mb, i then thought it may be because of constant 9999 sized arays so i set them all to 999 and recompiled the app the same warning + error is returned even the total image size bit is the same, so i tried removing the bitmap loading and sprite loading bits, the erorr is the same and the size is still the same, ca anyone help me plz?

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> ca anyone help me plz?

    Not with the given info. You could try to dynamically allocate your arrays rather than statically. Post your code/resources/headers/files, (you can zip them together and post a .zip), and perhaps someone will have time to look at it, I can't promise, I'm a biit busy at the moment.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    Posts
    186
    adrianxw is very correct. Looking at *just* the static integer arrays in EGAMMING.cpp, you're declaring over 763 megs.

    That is, 9999 integers @ 4 bytes/integer * 12 integer arrays = 479952 bytes = 468 kilobytes = 0.46 meg, which isn't bad. However, then come the two two-dimensional arrays:

    9999 * 9999 integers @ 4 bytes/integer * 2 integer arrays = 799840008 bytes = 781093 kilobytes = 762.79 meg, which is why the linker is complaining.

    Dynamic allocation won't help much; you might want to reconsider your graphics code. For starters, why would you need more than a couple bitmap handles or so many sprite position markers?
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

  4. #4
    Registered User MicroFiend's Avatar
    Join Date
    Nov 2002
    Posts
    80
    lol sorted it just before i was re checking this thread, yep u are right, the two dimensional array was the prob, i was using this array as to cover every x,y coordinate possible for the use of the object array, and ur right again i dont realy need this huge array, but i used it just in the off chance that someone wanted a huge dc, i was eventually aiming at making a program which creates small 2d games based on 2 bitmaps so this is the main reason i wanted this huge array, but ahwell, ive changed it to [999][999] which covers just enough for the next thing i wanted to do thanx for the help!! btw does anyone know why win NT versions dont allow this but 9x & ME versions do??

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    The 32 bit NT core is a far better OS than the 16/32 bit 9x cores, things you were "getting away with" in the poor systems were correctly trapped in the professional environment.

    >>> Looking at *just* the static integer arrays in EGAMMING.cpp,

    Where did you see that, I can't see any code?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    Registered User MicroFiend's Avatar
    Join Date
    Nov 2002
    Posts
    80
    lol sorry after i got it working i removed the file ^_^ thanx for your help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 01:03 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM