Article ID: 123780
Article Last Modified on 2/11/2002
APPLIES TO
- Microsoft Visual C++ 4.0 Cross Development Edition for Macintosh
This article was previously published under Q123780
SYMPTOMS
When calling the functions defined in SWAP.H from a C++ program, the link fails with an unresolved external, such as this one:
CAUSE
The header file (SWAP.H) in the MSVC20\M68K\INCLUDE directory is missing the necessary extern "C" block around the swap function declarations.
RESOLUTION
Surround the include of SWAP.H with an extern "C" block, as in this example:
extern "C" { #include <swap.h> }
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Sample Code
test.cpp #include <swap.h> void testFunc(void) { CbFreeSwapMem(2048); SetMaxSwapSize(4096); }
Additional query words: buglist2.00
Keywords: kbbug kblangcpp KB123780