Model Loading Problems

Started by
4 comments, last by MarcusMaximus 20 years, 1 month ago
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
-Mark
Advertisement
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.
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.
darn, beat to it
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
-Mark
WOOHOO!!! IT WORKS!!! THANKS SO MUCH FOR YOUR HELP!!! I found out i accidentally deleted the filename when i made the ifstream so there was no file. THANKS!!!

-Mark
-Mark

This topic is closed to new replies.

Advertisement