error LNK2005: _MEDIASUBTYPE_I420 already defined in CaptureVideo.obj 怎么解决

来源:百度知道 编辑:UC知道 时间:2024/06/25 08:22:53
用directshow做一个视频播放 出现下面的错误
Linking...
test6c.obj : error LNK2005: _MEDIASUBTYPE_I420 already defined in CaptureVideo.obj
test6c.obj : error LNK2005: _MEDIASUBTYPE_IYUV2 already defined in CaptureVideo.obj
test6cDlg.obj : error LNK2005: _MEDIASUBTYPE_I420 already defined in CaptureVideo.obj
test6cDlg.obj : error LNK2005: _MEDIASUBTYPE_IYUV2 already defined in CaptureVideo.obj
Debug/test6c.exe : fatal error LNK1169: one or more multiply defined symbols found
执行 link.exe 时出错.

test6c.exe - 1 error(s), 0 warning(s)

检查工程Link选项中是否同时包含了多个功能相同或者类似的LIB的不同版本,如果有,仅保留一个。

MSDN原文:

--------------------------------------
Linker Tools Error LNK2005
symbol already defined in object

The given symbol, displayed in its decorated form, was multiply defined.

Tips

One of the following may be a cause:

The most common cause of this error is accidentally linking with both the single-threaded and multithreaded libraries. Ensure that the application project file includes only the appropriate libraries and that any third-party libraries have appropriately created single-threaded or multithreaded versions.

The given symbol was a packaged function (created by compiling with /Gy) and was included in more than one file but was changed between compilations. Recompile all files that include the symbol.

The given symbol was defined differently in two member objects in different libraries, and both member objects were used.