🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

lesson 6 in vc++ 2005

Started by
3 comments, last by majj 17 years, 8 months ago
I tried till lesson 5 and got stuck in lesson 6 when my compiler started complaining that function 'free' is not identified! But when I convert the downloaded project and run it in vc++ 2005 the programme work perfect! How can it be? /* Now we free up any ram that we may have used to store the bitmap data. We check to see if the bitmap data was stored in TextureImage[0]. If it was we check to see if the data has been stored. If data was stored, we erase it. Then we free the image structure making sure any used memory is freed up. if (TextureImage[0]) // If Texture Exists { if (TextureImage[0]->data) // If Texture Image Exists { free(TextureImage[0]->data); // Free The Texture Image Memory } free(TextureImage[0]); // Free The Image Structure }*/ HOW CAN I CORRECT THE ERROR OR IS THE ABOVE CODING IS REALLY NECCESARY?
Advertisement
ANY ONE TRIED LESSON 6 IN VC++ 2005 PLEASE HELP!
Quote: Original post by majj
I tried till lesson 5 and got stuck in lesson 6 when my compiler started complaining that function 'free' is not identified! But when I convert the downloaded project and run it in vc++ 2005 the programme work perfect! How can it be?
If it works perfectly, then what's the problem?

If your edited version doesn't work, but the downloaded one does, what are the differences between the two?
Malloc/Free are located in the <cstdlib> or <stdlib.h> headers. If you're using a C++ compiler, use cstdlib, otherwise use stdlib.h.

Toolmaker

The downloaded version is written in vc++ 2003 and I'm using vc++ 2005.The converted version compiles correctly,it does'nt give any error message for the function 'free'.I though it is a function defined in on of the header files that i included.But when i create my own project in vc++ 2005 with all the correct header files libreries and all that my compiler says 'free' idenitifier is not found.How can it be? It should hav given the same error messge to the converted project also isn't it?

This topic is closed to new replies.

Advertisement