FIX: LNK1152 & LNK1141 When Linking OLE Control to Mapi32.libLast reviewed: September 19, 1997Article ID: Q141485 |
4.00
WINDOWS NT
kbole kbbuglist kbfixlist kbcode
The information in this article applies to:
SYMPTOMSAttempting to link an OLE Control project with Mapi32.lib results in the following warnings and errors: warning LNK4022: cannot find unique match for symbol "DllCanUnloadNow" warning LNK4002: _DllCanUnloadNow defined in C:\MSDEV\LIB\MAPI32.LIB warning LNK4002: _DllCanUnloadNow@0 defined in C:\MSDEV\MFC\lib\mfcs40d.libwarning LNK4002: _DllCanUnloadNow@0 defined in C:\MSDEV\LIB\oleaut32.libwarning LNK4022: cannot find unique match for symbol "DllGetClassObject"warning LNK4002: _DllGetClassObject defined in C:\MSDEV\LIB\MAPI32.LIB warning LNK4002: _DllGetClassObject@12 defined in C:\MSDEV\MFC\lib\mfcs40d.libwarning LNK4002: _DllGetClassObject@12 defined in C:\MSDEV\LIB\oleaut32.libfatal error LNK1152: cannot resolve one or more undecorated symbols fatal error LNK1141: failure during build of exports file
CAUSEThe import library for the Mapi32.dll (Mapi32.lib) incorrectly exports the DllCanUnloadNow and DllGetClassObject functions. These functions should be exported privately and not included in the import library.
RESOLUTIONTo work around this problem, build the Mapi32.lib import library from scratch by using the Lib.exe utility included with Visual C++ 4.0. Copy the sample code listed below into a text file, and save it as Mapi32.def. From the command prompt, enter the following command line to execute the Lib.exe utility and build a new Mapi32.lib import library:
LIB /DEF:MAPI32.DEFReplace the incorrect Mapi32.lib file located in the ~\Msdev\Lib directory with this newly created Mapi32.lib file, and rebuild the OLE Control project.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 4.1.
MORE INFORMATIONFor additional information on how to build import libraries without access to source files, please refer to the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q131313 TITLE : How to Create 32-bit Import Libraries Without .OBJs or Source Sample Code; Mapi32.def : Used DUMPBIN /EXPORTS to determine the functions and ; ordinal values listed in the EXPORTS section below. Note ; DllCanUnloadNow, DllGetClassObject, and WEP are NOT listed below.
LIBRARY "MAPI32.DLL"EXPORTS BMAPIAddress @35 BMAPIDetails @37 BMAPIFindNext @34 BMAPIGetAddress @36 BMAPIGetReadMail @33 BMAPIReadMail @32 BMAPIResolveName @38 BMAPISaveMail @31 BMAPISendMail @30 MAPIAddress @19 MAPIDeleteMail @17 MAPIDetails @20 MAPIFindNext @16 MAPIFreeBuffer @18 MAPILogoff @12 MAPILogon @11 MAPIReadMail @15 MAPIResolveName @21 MAPISaveMail @14 MAPISendDocuments @10 MAPISendMail @13 |
Additional reference words: LNK1152 LNK1141 LNK4022 LNK4002 4.00 Win32 sdk
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |