Prefast with Visual studio 2008

拜拜、爱过 提交于 2019-12-19 02:34:08

问题


Is there any way to enable Prefast in Visual Studio 2008 Professional addition?

I am trying to compile native c++ code.

I have tried following things,

  1. Downloaded Windows SDK
  2. Set compiler's Bin / Include / Lib paths to the SDK.
  3. Added additional option for c/c++ compilation (/Analyze:WX-)

I believe these steps should have set the appropriate compiler to do static analysis using prefast. This setting actually worked with Visual Studio 2005. However it does not work with Visual Studio 2008.

It always gives two problems

  1. LINK : warning LNK4044: unrecognized option '/MANIFESTUAC:level='asInvoker' uiAccess='false''; ignored
  2. fatal error LNK1103: debugging information corrupt; recompile module

Reason for 1, I believe, is Windows SDK do not identify /MANIFESTUAC option. This has been introduced with Visual Studio 2008. Reason for 2, no idea :).

Any idea / suggestions / pointers are most welcome.


回答1:


VS 2008 has a built-in code analysis (FxCop and PREfast). You can turn it on at Project->Properties->Configuration Properties->C/C++->Advanced->Enable Code Analysis For C/C++ on Build.

Then you can try to compile some examples from PREfast and see warnings.

Good luck!

EDIT: Professional edition has no such option :(




回答2:


You don't need to use Prefast separately. Visual C++ Prefast is accessed using the /analyze compiler switch.




回答3:


Code Analysis works for VS C ++ Express, but for visual studio ... I can not find it ... VS C++ Express and VS have some differences.



来源:https://stackoverflow.com/questions/888303/prefast-with-visual-studio-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!