How do I get sal.h How do I get sal.h windows windows

How do I get sal.h


It's located in

"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include" (VS 2008)

or

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" (VS 2010)

or

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include" (VS 2012)

of course, you may want to adapt to your local setup paths.


As the previous answer says, SAL is a Visual Studio thing. IMHO it's a great technology which helps the compiler understand the code so it can emit warnings when you do something wrong. Unfortunately, Microsoft seems to own a patent on it so other compilers can't implement it ☹. Even if you grab a copy of sal.h from your VS install I sincerely doubt it will work with mingw since it will translate the macros into attributes gcc/mingw doesn't understand.

I put together a small project called Salieri a while back which is basically a portable version of the SAL header that just defines away the SAL macros. You won't get any of the benefits of SAL annotated code, but it should help you get code which uses SAL to compile on other compilers.

Sorry to promote my own project here, but I think it could be useful for a lot of people coming across this post.