Archived

This topic is now archived and is closed to further replies.

Model Loading Problems

This topic is 5021 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When trying to test Nehe''s model loading tutorial in VC++.net I get a runtime error saying "Invalid Allocation Size: 4294967295 bytes." This is a really big number and I have no idea why it would be trying to allocate that much. Any help would be greatly appreciated. -Mark

Share this post


Link to post
Share on other sites
that number looks suspiciously like maxint-1

is it possible that the

long fileSize = inputFile.tellg();

is returning -1, i.e. there is no spoon, sorry, file?

So I''m guessing somewhere a:

x = new Something [-1];

is happening.

lonesock

Piranha are people too.

Share this post


Link to post
Share on other sites
I might be wrong on this, but that high of a number could be because its a signed value being flipped. Check if your possably trying to allocate a negative number.

Share this post


Link to post
Share on other sites
ok i figured out for some reason
inputFile.seekg( 0, std::ios::end );
long fileSize = inputFile.tellg();

is making fileSize a negative number. Im having trouble finding out exactly which negative number but i believe it''s -1. I know the file im reading from exists, so im not sure why it''s returning a negative number. Again, any incite would be very helpful

-Mark

Share this post


Link to post
Share on other sites