FIX: L2029 Error Calling ODBC Functions from ODBC SDK

ID: Q108522


The information in this article applies to:


SYMPTOMS

When building an application using the ODBC Software Development Kit (SDK), linker error L2029 "unresolved external" may occur on calls made to ODBC functions.


CAUSE

Several header files included with the ODBC SDK are missing extern "C" statements, which are needed to make them compatible with a C++ compiler. The functions residing in the ODBC libraries do not have decorated names, and therefore the extern "C" statement is necessary if you are calling the functions from an application written in C++.

The following header files are affected by this problem:


   SQL.H
   SQLEXT.H
   ODBCINST.H
   ODBCVER.H 


RESOLUTION

There are two ways to handle this problem:


STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. The problem was corrected in Visual C++ for Windows version 1.5 by including new versions of the four header files listed above.

Additional query words: 1.00 1.50 7.00 8.00 8.00c


Keywords          : kb16bitonly kbCompiler kbCPPonly kbVC 
Version           : 7.00   | 1.00
Platform          : MS-DOS WINDOWS 
Issue type        : 

Last Reviewed: July 30, 1999