Thread: stdafx.h and the FreeType library

  1. #1
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195

    stdafx.h and the FreeType library

    Hi. I wrote a win32 program that uses some of the MFC functionality and the freetype library. the problem i'm having is that if I dont include stdafx.h, Everything works correctly as planned. but once I add in stdafx.h I get a heap corruption error when I try to delete my freetype objects. I do not have any memory leaks or any heap errors becuase the program itself is very simple and I went through it with a fine tooth comb.

    Is there a possibility that something inside stdafx.h may be modifying (or overloading) some memory management functionality so that a heap error occurs? Is it possible that freetype does not work with this particular header?

    I'm using the latest build of freetype.

    Any help on this matter is greatly appreciated!!
    Thanks.
    Founder and avid member of the Internationsl Typo Associateion

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Remember that stdafx.h is a precompiled header, usually including hundreds of other headers. They are headers, not .cpp files, so they don't include code. Also, if using precompiled hedares, you can't omit stdafx.h om any of your .cpp files, oor you'll get a compile error.
    I suggest you look for signs up memory corruption by monitoring the memory around the objects you create and see if they're modified. If yes, you can set a data breakpoint when the memory around the object changes.
    Good luck.

Popular pages Recent additions subscribe to a feed