Miranda IM的插件需要导出函数为Load和UnLoad
由于使用的CxImage库中存在名为Load的函数,故连接时出现如下错误:
Linking...
./MSNLike_dll.def : warning LNK4022: cannot find unique match for symbol "Load"
./MSNLike_dll.def : warning LNK4002: "int __cdecl Load(int)" (?Load@@YAHH@Z) defined in ./Debug/MSNLike_dll.obj
./MSNLike_dll.def : warning LNK4002: "public: bool __thiscall CxImage::Load(char const *,unsigned long)" (?Load@CxImage@@QAE_NPBDK@Z) defined in E:/work/MessangerInterface/msnlike_dll/MSNLike_dll/lib/cximagecrtd.lib
./MSNLike_dll.def : warning LNK4002: "public: int __thiscall CDialogTemplate::Load(char const *)" (?Load@CDialogTemplate@@QAEHPBD@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfc42d.lib
./MSNLike_dll.def : warning LNK4002: "public: static struct CRuntimeClass * __stdcall CRuntimeClass::Load(class CArchive &,unsigned int *)" (?Load@CRuntimeClass@@SGPAU1@AAVCArchive@@PAI@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC
/LIB/mfc42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall CBlobProperty::Load(struct IStream *)" (?Load@CBlobProperty@@UAGJPAUIStream@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: void __thiscall COleControl::Load(char const *,class CDataPathProperty &)" (?Load@COleControl@@QAEXPBDAAVCDataPathProperty@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfco42d.li
b
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleLinkingDoc::XPersistFile::Load(unsigned short const *,unsigned long)" (?Load@XPersistFile@COleLinkingDoc@@UAGJPBGK@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/M
FC/LIB/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleControl::XPersistMemory::Load(void *,unsigned long)" (?Load@XPersistMemory@COleControl@@UAGJPAXK@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleControl::XPersistPropertyBag::Load(struct IPropertyBag *,struct IErrorLog *)" (?Load@XPersistPropertyBag@COleControl@@UAGJPAUIPropertyBag@@PAUIErrorLog@@@Z) defined in C:/Progr
am Files/Microsoft Visual Studio/VC98/MFC/LIB/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleControl::XPersistStorage::Load(struct IStorage *)" (?Load@XPersistStorage@COleControl@@UAGJPAUIStorage@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfc
o42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleServerDoc::XPersistStorage::Load(struct IStorage *)" (?Load@XPersistStorage@COleServerDoc@@UAGJPAUIStorage@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB
/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleControl::XPersistStreamInit::Load(struct IStream *)" (?Load@XPersistStreamInit@COleControl@@UAGJPAUIStream@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB
/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: bool __thiscall CxImage::Load(char const *,unsigned long)" (?Load@CxImage@@QAE_NPBDK@Z) defined in D:/SourceCode/cximage599c_full/CxImage/CxImageDLL/Debug/cximagecrtd.lib
LINK : fatal error LNK1152: cannot resolve one or more undecorated symbols
LINK : fatal error LNK1141: failure during build of exports file
Error executing link.exe.
解决办法:
上述第二条出错信息中暗示了需要导出的Load函数在编译器内部的名字,故在.DEF文件中直接以此指明。如下:
Load=?Load@@YAHH@Z @11
参考连接:
http://www.codeguru.com/forum/printthread.php?t=308825
由于使用的CxImage库中存在名为Load的函数,故连接时出现如下错误:
Linking...
./MSNLike_dll.def : warning LNK4022: cannot find unique match for symbol "Load"
./MSNLike_dll.def : warning LNK4002: "int __cdecl Load(int)" (?Load@@YAHH@Z) defined in ./Debug/MSNLike_dll.obj
./MSNLike_dll.def : warning LNK4002: "public: bool __thiscall CxImage::Load(char const *,unsigned long)" (?Load@CxImage@@QAE_NPBDK@Z) defined in E:/work/MessangerInterface/msnlike_dll/MSNLike_dll/lib/cximagecrtd.lib
./MSNLike_dll.def : warning LNK4002: "public: int __thiscall CDialogTemplate::Load(char const *)" (?Load@CDialogTemplate@@QAEHPBD@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfc42d.lib
./MSNLike_dll.def : warning LNK4002: "public: static struct CRuntimeClass * __stdcall CRuntimeClass::Load(class CArchive &,unsigned int *)" (?Load@CRuntimeClass@@SGPAU1@AAVCArchive@@PAI@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC
/LIB/mfc42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall CBlobProperty::Load(struct IStream *)" (?Load@CBlobProperty@@UAGJPAUIStream@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: void __thiscall COleControl::Load(char const *,class CDataPathProperty &)" (?Load@COleControl@@QAEXPBDAAVCDataPathProperty@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfco42d.li
b
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleLinkingDoc::XPersistFile::Load(unsigned short const *,unsigned long)" (?Load@XPersistFile@COleLinkingDoc@@UAGJPBGK@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/M
FC/LIB/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleControl::XPersistMemory::Load(void *,unsigned long)" (?Load@XPersistMemory@COleControl@@UAGJPAXK@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleControl::XPersistPropertyBag::Load(struct IPropertyBag *,struct IErrorLog *)" (?Load@XPersistPropertyBag@COleControl@@UAGJPAUIPropertyBag@@PAUIErrorLog@@@Z) defined in C:/Progr
am Files/Microsoft Visual Studio/VC98/MFC/LIB/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleControl::XPersistStorage::Load(struct IStorage *)" (?Load@XPersistStorage@COleControl@@UAGJPAUIStorage@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB/mfc
o42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleServerDoc::XPersistStorage::Load(struct IStorage *)" (?Load@XPersistStorage@COleServerDoc@@UAGJPAUIStorage@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB
/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: virtual long __stdcall COleControl::XPersistStreamInit::Load(struct IStream *)" (?Load@XPersistStreamInit@COleControl@@UAGJPAUIStream@@@Z) defined in C:/Program Files/Microsoft Visual Studio/VC98/MFC/LIB
/mfco42d.lib
./MSNLike_dll.def : warning LNK4002: "public: bool __thiscall CxImage::Load(char const *,unsigned long)" (?Load@CxImage@@QAE_NPBDK@Z) defined in D:/SourceCode/cximage599c_full/CxImage/CxImageDLL/Debug/cximagecrtd.lib
LINK : fatal error LNK1152: cannot resolve one or more undecorated symbols
LINK : fatal error LNK1141: failure during build of exports file
Error executing link.exe.
解决办法:
上述第二条出错信息中暗示了需要导出的Load函数在编译器内部的名字,故在.DEF文件中直接以此指明。如下:
Load=?Load@@YAHH@Z @11
参考连接:
http://www.codeguru.com/forum/printthread.php?t=308825