I get a heap corruption error when deleting a pointer. For this project, the linking parameter for Randomized Base Address is set to Disable Image Randomization. Not sure why that is set that way. Anyway, I only get that error when a specific header file of a library is included. The strange thing is that even with that header file included, if the Randomized Base Address is set to Enable Image Randomization, the error does not appear. So is there really a heap corruption or should I just change the linking parameter?
Randomized Base Address tells whether or not to always load the library at the same address. Randomizing it provides some level of security to prevent exploits from calling/modifying the code.
Almost certainly there's a heap problem in your project, and most likely it's unrelated to the header being included. Chances are that the header introduces some symbol that makes use of the corrupted heap, causing the problem. Similarly, when randomizing the base address, your heap is still getting corrupted but the problem never manifests in a visibly-obvious way (although things may be working slightly incorrectly).
If you're able to use a memory checker or debug allocator that might be able to help you.
Otherwise unfortunately without code/more information it will be very hard to give you additional hints.
That header file included many header files. And a few of them used the #pragma pack preprocessor. I'm still unclear how that can cause the heap corruption but a google search about that preprocessor revealed the solution to use pragma push/pop. Not sure how common the use of that preprocessor is but nooone ever mentions about it when discussing heap corruption :(. Anyway, thanks for the help.