Causes of L2023 : Entry WEP : Export ImportedLast reviewed: July 22, 1997Article ID: Q104246 |
5.30 5.31.009 5.50 5.60
WINDOWS
kbtool kberrmsg
The information in this article applies to:
SYMPTOMSWhen building a dynamic-link library (DLL) with Visual C++, the following linker error can occur:
L2023 : entry WEP : export imported CAUSEThis error is usually caused by linking with a third-party DLL's import library that publicly exports its WEP (Windows exit procedure) routine.
RESOLUTIONAlthough removing the lines
EXPORTS WEP @1 RESIDENTNAMEfrom your .DEF file may avoid the error, this method is not recommended because there can be problems with Windows calling the WEP (either your own or the WEP provided by the DLL run-time library) when your DLL is unloaded. As stated, the most common cause of this error is linking with another DLL's import library that was built to publicly export a WEP function. If you are linking your DLL with other third-party or in-house import libraries, you may want to examine them closely. If some of these import libraries are yours, you can modify the way they are built so that they don't put their WEP routines into the import library. Either of the following steps will cause a DLL's exported WEP not to be added to its import library:
Windows libraries, C run-time libraries, third-party DLLsThis ensures that the correct WEP is pulled in from the Windows C run-time libraries (libraries matching the pattern xDLLCEW.LIB). NOTE: It is not recommended that you create your own WEP, rather than exporting the default WEP. DLL termination code should be in an _WEP routine, which the default WEP will call. This is described on page 119 and 120 of the Visual C++ 1.0 "Programming Techniques" manual, and on page 27 and 28 of the Visual C++ 1.0 "C/C++ Version 7.0 Update" manual. If for some reason you must use your own WEP routine, you may want to examine WEP.ASM in the \MSVC\SOURCE\WIN directory. This is the source for the default WEP that is pulled in from the C run-time libraries. In such a WEP, if your application is a C++ application, you need to make sure to call all destructors of global class objects. If you are creating a Microsoft Foundation Class (MFC) libraries version 2.0 DLL, then you can override the CWinApp::ExitInstance() member function to do your termination processing.
|
Additional reference words: kbinf kbinf 1.00 technote
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |