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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With