成功解决LINK:fatalerrorLNK1181:⽆法打开输⼊⽂
件“avdevice.。。。
成功解决LINK : fatal error LNK1181: ⽆法打开输⼊⽂件“avdevice.lib” error: command 'D:\\Program Files (x86)\\Micr
⽬录
解决问题
在进⾏av-6.2.0>python setup.py build develop安装的时候遇到的bug。
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\av
copying av\datasets.py -> build\lib.win-amd64-3.6\av
copying av\deprecation.py -> build\lib.win-amd64-3.6\av
copying av\__init__.py -> build\lib.win-amd64-3.6\av
copying av\__main__.py -> build\lib.win-amd64-3.6\av
creating build\lib.win-amd64-3.6\av\audio
copying av\audio\__init__.py -> build\lib.win-amd64-3.6\av\audio
creating build\lib.win-amd64-3.6\av\codec
copying av\codec\__init__.py -> build\lib.win-amd64-3.6\av\codec
creating build\lib.win-amd64-3.6\av\container
copying av\container\__init__.py -> build\lib.win-amd64-3.6\av\container
creating build\lib.win-amd64-3.6\av\data
copying av\data\__init__.py -> build\lib.win-amd64-3.6\av\data
creating build\lib.win-amd64-3.6\av\filter
copying av\filter\__init__.py -> build\lib.win-amd64-3.6\av\filter
creating build\lib.win-amd64-3.6\av\subtitles
copying av\subtitles\__init__.py -> build\lib.win-amd64-3.6\av\subtitles
creating build\lib.win-amd64-3.6\av\video
copying av\video\__init__.py -> build\lib.win-amd64-3.6\av\video
running build_ext
running config
writing build\temp.win-amd64-3.6\Release\include\pyav\config.h
running cythonize
building 'av.buffer' extension
creating build\temp.win-amd64-3.6\Release\src
creating build\temp.win-amd64-3.6\Release\src\av
D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_ /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -
Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Dinline=__inline -Iinclude "-IF:\Program Files\Python\Python36\inc
lude" "-ID://Program Files//ffmpeg" -Ibuild\temp.win-amd64-3.6\Release\include "-IF:\Program Files\Python\Python36\include" "-IF:\Program
Files\Python\Python36\include" -Ibuild\temp.win-amd64-3.6\Release\include "-ID:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-ID:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows
无法打开文件Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files
(x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcsrc\av\buffer.c
/Fobuild\temp.win-amd64-3.6\Release\src\av\buffer.obj
buffer.c
D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_ /nologo /INCREMENTAL:NO /LTCG
/DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:F:\Program Files\Python\Python36\PCbuild\amd64"
"/LIBPATH:F:\Program Files\Python\Python36\libs" "/LIBPATH:D://Program Files//ffmpeg" "/LIBPATH:F:\Program
Files\Python\Python36\libs" "/LIBPATH:F:\Program Files\Python\Python36\PCbuild\amd64" "/LIBPATH:D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:D:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64"
"/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files
(x86)\Windows Kits\8.1\lib\winv6.3\um\x64" avdevice.lib avformat.lib swresample.lib avcodec.lib swscale.lib avutil.lib avfilter.lib /EXPORT:PyInit_buffer build\temp.win-amd64-3.6\Release\src\av\buffer.obj /OUT:build\lib.win-amd64-
3.6\av\buffer.cp36-win_amd6
4.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\src\av\buffer.cp36-win_amd64.lib
/OPT:NOREF
LINK : fatal error LNK1181: ⽆法打开输⼊⽂件“avdevice.lib”
error: command 'D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\' failed with exit status 1181
解决⽅法
参考⽂章:
您可以添加包含libclamav的⽬录。lib库⽂件到LIBPATH解决这个问题(这个说明可能会有所不同,取决于你的Visual Studio版本):在“解决⽅案资源管理器”中,右键单击项⽬,然后单击“属性”。
在“属性页”对话框中展开“链接器”,然后单击“常规”。
在附加库⽬录字段中,指定libclamav所在的路径,libclamav.lib
当LIBPATH包含空格时也可能发⽣错误。如果是这种情况,请将库移动到没有空格的路径上,或者在路径周围加上引号。
我希望我能给你1000个赞!我试图更新⼀个遗留项⽬,LIBPATH中有空格!我已经了好⼏个⼩时了,没⼈告诉我。我不知道它在原来的开发环境中是如何⼯作的!也许他们碰巧也有它在LIB环境……⽆论如何,我不知道更现代的VS版本是如何处理这个问题的,但是vc++ 6(别问了!)并没有优雅表⽰。- 5⽉19⽇14时9分12秒
为了防⽌别⼈⽆意中发现我的错误,我犯了⼀个更基本、更愚蠢的错误。我试图在“仅在项⽬中”构建。确保先构建您的依赖项!右键点击你的项⽬⽂件,然后点击build。- 12⽉22⽇15时20分47秒
以上为原⽂翻译,欢迎⼴⼤⽹友提供更好的思路!
发布评论