5 c++ code-analysis visual-studio-2012
我最近安装了VS2011测试版,以了解微软在其最新版本的编译器中实现的新C++ 11功能.
我回去使用VS2010时遇到了意想不到的问题.我在VS2010中打开了一个Windows SDK 7.1示例项目.
现在,当我在VS2010中构建时,我得到以下输出,表示正在执行代码分析工具(看似在编译之后,但在链接之前)
1>------ Rebuild All started: Project: MFCaptureToFile, Configuration: Debug Win32 ------
1> winmain.cpp
1> capture.cpp
1> Running Code Analysis for C/C++...
1>capture.cpp(112): error C2220: warning treated as error - no 'object' file generated
1>c:\program files\microsoft sdks\windows\v7.1\samples\multimedia\mediafoundation\mfcapturetofile\capture.cpp(105): warning C6309: Argument '3' is null: this does not adhere to function specification of 'IMFAttributes::GetAllocatedString'
1>c:\program files\microsoft sdks\windows\v7.1\samples\multimedia\mediafoundation\mfcapturetofile\capture.cpp(105): warning C6387: 'argument 3' might be '0': this does not adhere to the specification for the function 'IMFAttributes::GetAllocatedString': Lines: 98, 103, 105
1>c:\program files\microsoft sdks\windows\v7.1\samples\multimedia\mediafoundation\mfcapturetofile\capture.cpp(353): warning C6309: Argument '3' is null: this does not adhere to function specification of 'IMFAttributes::GetAllocatedString'
1>c:\program files\microsoft sdks\windows\v7.1\samples\multimedia\mediafoundation\mfcapturetofile\capture.cpp(353): warning C6387: 'argument 3' might be '0': this does not adhere to the specification for the function 'IMFAttributes::GetAllocatedString': Lines: 336, 338, 340, 343, 351, 353
1>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\ks.h(53): error C2220: warning treated as error - no 'object' file generated
1>c:\program files\microsoft sdks\windows\v7.1\include\ks.h(53): warning C6244: Local declaration of 'GUID_NULL' hides previous declaration at line '28' of 'c:\program files\microsoft sdks\windows\v7.1\include\cguid.h'
1> Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Run Code Online (Sandbox Code Playgroud)
我试图确定项目的哪些更改导致代码分析工具被执行,但我在项目属性中找不到任何内容.我已经尝试在VS2011中重新加载项目,但我无法关闭代码分析(如MSDN上所建议的).
该项目完全是原生C++,我从未使用C++和CLR
此外,我尝试打开其他项目(我自己的),现在他们也在调用这个代码分析阶段.在许多情况下,这可以防止因Microsoft代码问题而构建!构建似乎在VS2011 beta中取得了成功.
任何人都可以提供有关如何关闭此代码分析工具的见解吗?我希望安装VS2011测试版,所以请不要建议卸载它,除非它是唯一的选择!
Zai*_*mir 12
我认为只有VS2010 Ultimate支持代码分析.我没有VS2012,但我认为你应该手动编辑vcxproj文件.
如果它们存在于项目文件中<RunCodeAnalysis>true</RunCodeAnalysis>,请查找其中一个或两个参数:
和<EnablePREfast>true</EnablePREfast>
将两个值更改为false,它应该工作.
请注意,VS2010使用这些名称,我不确定他们是否在VS2012中更改了它们.
| 归档时间: |
|
| 查看次数: |
1272 次 |
| 最近记录: |