You may receive an "error LNK2001 unresolved external symbol __chkesp" error message when you build a project with Visual C++ 6.0 (191669)



The information in this article applies to:

  • The C Run-Time (CRT), when used with:
    • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
    • Microsoft Visual C++, 32-bit Professional Edition 6.0
    • Microsoft Visual C++, 32-bit Learning Edition 6.0

This article was previously published under Q191669

SYMPTOMS

When building a project with Visual C++ 6.0, you may get the following linker error:
error LNK2001: unresolved external symbol __chkesp

CAUSE

The new compiler stack-checking feature requires you to link with the C run-time library.

RESOLUTION

Either link with one of the C run-time libraries or disable the compiler stack-checking feature (remove /GZ from the compiler switches).

STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the behavior

Sample code

   // test.cpp
   // compile with: cl /GZ test.cpp /link /nod
   void f() {}
   int main ()
   {
      f();
      return 0;
   }
				

Modification Type:MajorLast Reviewed:10/3/2005
Keywords:kbtshoot kberrmsg kbCompiler kbprb KB191669 kbAudDeveloper