Ldc ImportC preprocessor failure (wrong option syntax) on Windows
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Tue Feb 4 09:57:27 UTC 2025
On 04/02/2025 10:50 PM, Bastiaan Veelo wrote:
> Hi,
>
> On my personal machine everything works fine, but our CI build machine
> suffers from this error:
> ```
> clang-cl.exe: warning: unknown argument ignored in clang-cl '-
> target' (did you mean '--target='?) [-Wunknown-argument]
> clang-cl.exe: error: no such file or directory: 'x86_64-pc-windows-msvc'
> ```
>
> I have the impression that options are given as the Microsoft
> preprocessor expects them, but that the clang preprocessor is called
> instead. I think that on my personal machine the Microsoft preprocessor
> is called, which is also what I would expect, but I don't know of a way
> to verify that; the workings of ImportC are rather opaque.
ldc and dmd have differing behaviors.
https://github.com/ldc-developers/ldc/blob/master/driver/cpreprocessor.cpp
And yes it prefers clang-cl.
Which means this is a bug.
> My hunch is that LDC doesn't detect the presence of the Microsoft
> toolchain correctly. I do call `vcvarsall.bat x64` prior to invoking
> ldc. Could there be a global configuration in effect on my personal
> machine, but not on the CI build machine? One difference is that,
> although we currently install compilers by unzipping archives and adding
> to PATH, on my personal machine I have used the Windows Installer in the
> past, which may have done additional things to configure my system.
Add to PATH, remove old.
That is all you need to do for installation after extraction.
More information about the Digitalmars-d-learn
mailing list