解决问题
在进行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_amd64\cl.exe /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 -Iinclude "-IF:\Program Files\Python\Python36\include" "-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_amd64\link.exe /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_amd64.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\\link.exe' failed with exit status 1181
解决方法
参考文章:LINK : fatal error LNK1181: cannot open input file 'libclamav.lib'
你得到一个LNK1181错误在Visual Studio LIB或.obj文件指定在连接在当前目录没有发现,任何指定的目录LIBPATH链接器选项,或任何的LIB环境变量中指定的目录。
您可以添加包含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秒
以上为原文翻译,欢迎广大网友提供更好的思路!