Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get sal.h

I have been trying to compile a program with minw32, on win7. Every time I try to compile this, I get an error about sal.h missing. I have downloaded both Visual Studio c++ 2010 (Express) and have gotten the Microsoft Win7 SDK. Even after all this, I still haven't found that header file. Is there any place I could download it from?

like image 768
Clay Avatar asked Dec 13 '10 22:12

Clay


2 Answers

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.

like image 94
Simon Mourier Avatar answered Sep 20 '22 13:09

Simon Mourier


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.

like image 39
nemequ Avatar answered Sep 17 '22 13:09

nemequ