Thread overview
[Issue 24308] [ImportC] druntime\import\importc.h(134): fatal error C1034: sal.h: no include path set
Jan 04
kinke
December 30
https://issues.dlang.org/show_bug.cgi?id=24308

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
This problem surfaced after:

    #include "sal.h"

was added by:

    https://github.com/dlang/dmd/pull/15563

I'm wondering if the problem you're seeing is the INCLUDE environment variable that points to the VC include directory has not been set?

--
December 31
https://issues.dlang.org/show_bug.cgi?id=24308

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ImportC
           Hardware|x86                         |All

--
December 31
https://issues.dlang.org/show_bug.cgi?id=24308

Adam Wilson <flyboynw@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |flyboynw@gmail.com

--- Comment #2 from Adam Wilson <flyboynw@gmail.com> ---
This is due to MSFT's [SAL Annotations
Library](https://learn.microsoft.com/en-us/cpp/c-runtime-library/sal-annotations?view=msvc-170)
that they use as metadata. We added this because we need to disable this
anytime an MSFT header gets included by ImportC.

This should be solved by using the Developer Command Prompt from Visual Studio as that will correctly setup the %INCLUDE% environment variable. In general, when using ImportC on Windows you should be invoking DMD from the Dev Prompt because you're using the whole compiler tool-chain.

--
January 02
https://issues.dlang.org/show_bug.cgi?id=24308

--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
Yeah so it was indeed the missing include. Feel free to close, anyone else running into the same problem will likely find this bug report.

Though maybe we should make a suggestion on the ImportC page that if using Windows it's a good idea to set up vcvars / use the Dev Prompt.

--
January 04
https://issues.dlang.org/show_bug.cgi?id=24308

kinke <kinke@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke@gmx.net

--- Comment #4 from kinke <kinke@gmx.net> ---
This looks like a duplicate of https://issues.dlang.org/show_bug.cgi?id=24111. This is definitely fixable in DMD (should work with LDC as-is), see https://github.com/dlang/dmd/pull/15780#issuecomment-1797101116.

--