且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio 2012 Express代码分析

更新时间:2021-09-26 04:56:39

据我所知,代码分析仅在VS Express 2012 用于Windows桌面中可用-如果您有其他一些版本( Windows桌面版本除外),则可能不支持该版本。尝试谷歌搜索您的特定版本以确保。

As far as I know, code analysis is only available in VS Express 2012 For Windows Desktop - if you have some other version than the "for Windows Desktop" version, it may not be supported. Try Googling your specific version to make sure.

平台工具集可能不支持这些选项(项目属性->常规->平台工具集) 。

It may be that these options are not supported by your "platform toolset" (project properties -> general -> platform toolset).

例如,v110支持它,而v110_xp似乎不支持。

For example, v110 supports it, v110_xp does not seem to.

您仍然可以尝试构建菜单->在解决方案上运行代码分析(或按热键Alt-F11),但这会在您遇到问题时给您错误MSB8026:不支持静态分析当前平台工具集。

You can still try the "Build" menu -> "Run Code Analysis on Solution" (or hit the hotkey Alt-F11) but this will, if this is your problem, give you "error MSB8026: Static analysis is not supported with the current platform toolset."

如果这不起作用,请尝试项目属性-> C / C ++->常规-> SDL检查并将其设置为是( / sdl)。我隐约记得,直到我这样做时,它才对我显示,但是即使我再次删除该选项,代码分析选项也不会消失,因此可能不相关。

If that doesn't work, try project properties -> C/C++ -> General -> SDL checks and setting that to "Yes (/sdl)". I vaguely remember that it didn't show up for me until I did that, but even when I remove that option again, the code analysis option doesn't go away, so might not be related.

如果您需要(就像我一样)用于正常构建的其他平台工具集(不支持代码分析),则可能会导致您的Debug或Release配置无效,***创建一个单独的分析配置:项目属性->配置管理器->活动解决方案配置->新建...->输入分析,从调试中复制设置。然后,您可以在其中设置平台工具集,并进行分析,而不必担心会破坏您的常规配置。

If you need (as I do) a different platform toolset for your normal builds, which does not support code analysis, then rather than beak your Debug or Release configurations, it may be better to create a separate "Analyze" configuration: project properties -> "Configuration Manager" -> Active solution configuration -> "New..." -> type "Analyze", copy across the settings from "Debug". Then you can set the platform toolset in there, and enable analysis, and not worry about it breaking your normal configurations.

尽管如此,我仍然无法理解它可以找到任何错误,即使我知道错误存在。因此,ymmv。

Even after all that though, I can't get it to find any errors, even though I know errors exist. So, ymmv.