當我嘗試在我的項目中使用DCMTK(/ MT)庫時,出現以下鏈接錯誤。我相信這些錯誤與VS2010的ws2_32.lib wsock32.lib netapi32.lib有關。但我已經將這三個庫添加到項目屬性中。你可以看到這個庫已經被搜索到了,如下所示。這些庫位於C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.0A \ lib中。訂單問題?任何建議?Visual Studio 2010庫鏈接錯誤
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "bool __cdecl `anonymous namespace'::CopySid(struct _SID * *,struct _SID *)" ([email protected][email protected]@[email protected]@[email protected]@Z)
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "bool __cdecl `anonymous namespace'::CopySid(struct _SID * *,struct _SID *)" ([email protected][email protected]@[email protected]@[email protected]@Z)
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "bool __cdecl `anonymous namespace'::GetCurrentUserSID(struct _SID * *)" ([email protected][email protected]@[email protected]@@Z)
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "bool __cdecl `anonymous namespace'::GetCurrentUserSID(struct _SID * *)" ([email protected][email protected]@[email protected]@@Z)
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "struct HKEY __ * __cdecl `anonymous namespace'::regGetKey(class OFString const &,unsigned long *)" ([email protected][email protected]@YAPAUHKEY [email protected]@[email protected]@[email protected])
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl `anonymous namespace'::regSetString(struct HKEY __ *,class OFString const &,class OFString const &)" ([email protected][email protected]@YAXPAUHKEY [email protected]@[email protected]@[email protected])
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: void __thiscall log4cplus::NTEventLogAppender::init(void)" ([email protected]@[email protected]@IAEXXZ)
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual void __thiscall log4cplus::NTEventLogAppender::close(void)" ([email protected]@[email protected]@UAEXXZ)
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: virtual void __thiscall log4cplus::NTEventLogAppender::append(class log4cplus::spi::InternalLoggingEvent const &)" ([email protected]@[email protected]@[email protected]@[email protected]@Z)
1>oflog.lib(ntelogap.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: void __thiscall log4cplus::NTEventLogAppender::addRegistryInfo(void)" ([email protected]@[email protected]@IAEXXZ)
這裏是LIB搜索的詳細部分:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ws2_32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\netapi32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\wsock32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\libcpmtd.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\LIBCMT.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\OLDNAMES.lib:
....
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\msvcprtd.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\MSVCRTD.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\LIBCMTD.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
....
那麼,你已經知道問題是什麼。所以不要猶豫,將這些庫添加到鏈接器+輸入+附加依賴關係設置。 –
嗨,漢斯:如上圖所示的lib搜索日誌,我已經添加了libs – eatcpp