Article ID: 140440
Article Last Modified on 10/16/2002
APPLIES TO
- Microsoft Visual C++ 4.0 Standard Edition
This article was previously published under Q140440
SYMPTOMS
When globally overloading operator delete, the linker may generate the following errors when building in the debug mode and using the static C run-time libraries:
RESOLUTION
The problem only appears with the static C run-time libraries for the debug mode; it does not occur when using the release mode. Also at this time, the problem is noted to occur only when an iostream object is linked in. For example, in the code fragment listed in the "Steps to Reproduce Problem" section of this article, if you change the statement to output to "cout" into a comment inside main(), the problem does not occur.
To work around this problem:
- Use the DLL version of the C Run-Time library.
- Bring up the Project Settings dialog box. On the Build menu, click Settings. Click the Link tab, and select the Customize category. Select the Force File output option. This forces the linker to generate the executable regardless of the error.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 4.1.
MORE INFORMATION
Steps to Reproduce Problem
Build the following program as a console application using the debug mode.
// test.cpp #include <iostream.h> #include <malloc.h> void operator delete (void *p) { free (p); } void main() { cout << "main" << endl; }
Additional query words: 4.00 4.10
Keywords: kbbug kbfix kbcrt kbvc410fix KB140440