FIX: LNK1152 & LNK1141 When Linking OLE Control to Mapi32.lib (141485)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q141485 SYMPTOMS
Attempting 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.lib
warning LNK4002: _DllCanUnloadNow@0 defined in
C:\MSDEV\LIB\oleaut32.lib
warning 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.lib
warning LNK4002: _DllGetClassObject@12 defined in
C:\MSDEV\LIB\oleaut32.lib
fatal error LNK1152: cannot resolve one or more undecorated symbols
fatal error LNK1141: failure during build of exports file
CAUSE
The 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.
RESOLUTION
To 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:
Replace the incorrect Mapi32.lib file located in the ~\Msdev\Lib directory
with this newly created Mapi32.lib file, and rebuild the OLE Control
project.
STATUS
Microsoft 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.
Modification Type: | Major | Last Reviewed: | 10/24/2002 |
---|
Keywords: | kbBug kbCtrl kbDLL kbNoUpdate kbVC410fix KB141485 |
---|
|