MSVCRTD.lib 有关的错误

本文解决了在编译DirectShow相关程序时遇到的链接错误,包括重复定义和未解析外部符号等问题。通过忽略特定库文件LIBCMTD.lib,可以有效避免冲突。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译和DirectShow有关的程序时出现下列错误

1>Linking...
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>./Debug/TrackingMS.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://c:/Documents and Settings/vicky/桌面/meanshift/VideoTrack_code/MSTracking/Debug/BuildLog.htm"
1>TrackingMS - 3 error(s), 16 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

或者类似下列错误(the errors of "unresolved external symbol" appear when I ignore MSVCRTD.lib, which include wcsrchr and StringVPrintfWorkerA)

1>strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __imp__wcsrchr referenced in function "wchar_t * __cdecl wcsrchr(wchar_t *,wchar_t)" (?wcsrchr@@YAPA_WPA_W_W@Z)
1>strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __imp___vsnprintf referenced in function "long __stdcall StringVPrintfWorkerA(char *,unsigned int,char const *,char *)" (?StringVPrintfWorkerA@@YGJPADIPBD0@Z)

解决方法是

ignore the LIBCMTD.lib:Link->Input->Ignore specific library

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值