I'm Michael Suodenjoki - a software engineer living in Kgs. Lyngby, north of Copenhagen, Denmark. This is my personal site containing my blog, photos, articles and main interests.

Updated 2011.01.23 15:37 +0100

 

Hey, cl.exe /analyze disappeared!

C++ Static Code Analysis disappeared after installing Visual C++ 2008 Feature Pack

In my February post Analyze This I've described that by downloading and installing version 6.1 of the Windows SDK - also dubbed with the long name Microsoft Windows SDK for Windows Server 2008 (6001.18000.367), which happens to be the name used in Control Panel's Programs and Features Software Explorer, formerly the Add/Remove Programs (ARP), you could get static code analysis for free in your C++ build environment - aka. the /analyze command option to the C++ compiler (cl.exe).

I've been using this a lot and find it a great feature. 

However after installing the new great Visual C++ 2008 Feature Pack (read this for some background) the cl.exe /analyze option disappeared, went heywire,  smoked - call it what you like. I could not use it anymore. It was gone. Hmm, strange.

The Solution

I don't exactly know what the Windows SDK v6.1 install do to my C++ compiler because the compiler version (15.00.21022.08) - outputted on the command line is the same both before and after installing Windows SDK v6.1, but it certainly do something, because if I reinstall it the cl.exe /analyze feature comes back.

Cl.exe in the command prompt

TIP: I've found that you don't need to reinstall the entire Windows SDK, it will be enough just to run the vc_stdx86.msi (for 32-bit) available in the Setup folder of the Windows SDK CD/iso file.