PRB: ODBC.LIB Causes Error L2023: entry WEP: export imported

Last reviewed: July 22, 1997
Article ID: Q133069
1.50 1.51 1.52 1.52A WINDOWS kbtool

The information in this article applies to:

  • The Microsoft Linker (LINK.EXE) included with: Microsoft Visual C++ for Windows, version 1.5, 1.51, 1.52, 1.52A

SYMPTOMS

When building a dynamic-link library (DLL) with Visual C++ that links with ODBC.LIB, the following linker error occurs:

   L2023 : entry WEP : export imported

CAUSE

The ODBC.LIB file that ships with Visual C++ and the ODBC Software Development Kit (SDK) publicly export the Window Exit Procedure (WEP). Because this function must be exported by all 16-bit DLLs, including this library in a DLL project causes the L2023 link error.

RESOLUTION

If ODBC is not being used in the DLL, simply remove ODBC.LIB from the list of additional libraries.

If ODBC is needed, generate a new import library from ODBC.DLL by using the IMPLIB utility. The following command generates a replacement library for ODBC.LIB called NEWODBC.LIB that does not contain a reference to WEP:

   IMPLIB /nowep NEWODBC.LIB ODBC.DLL

Execute this command from the directory that contains ODBC.DLL. After creating NEWODBC.LIB, copy it into the Visual C++ LIB directory, and change the project setting to use NEWODBC.LIB instead of ODBC.LIB.

STATUS

This behavior is by design.

REFERENCES

For more information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q104246
   TITLE     : Causes of L2023 : Entry WEP : Export Imported


Additional reference words: 1.50 1.51 1.52 1.52A
KBCategory: kbtool kbprb
KBSubcategory: LinkIss MfcDatabase
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.