stdafx.h and the FreeType library

This is a discussion on stdafx.h and the FreeType library within the Windows Programming forums, part of the Platform Specific Boards category; Hi. I wrote a win32 program that uses some of the MFC functionality and the freetype library. the problem i'm ...

  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をこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,546
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21