Bindgen Problem Running on ARM Windows 11 on Apple Silicon


I'm trying to build my own project that builds fine on an Intel Windows 11 PC.

I'm now trying to build it on an Apple M3 laptop with Parallels running ARM Windows 11. Part of the project using bindgen to bring in some of the Windows headers. It's not working in parallels.

I've Visual Studio 2022 Pro installed and LLVM.

I get an error
Unable to find libclang: "the libclang shared library at C:\Program Files\LLVM\bin\libclang.dll could not be opened: LoadLibraryExW failed"

LLVM and libclang.dll is installed in the directory its looking for.

Has anyone successfully built with Bindgen and a similar setup? If so, any tips?


Zero experience with this situation, so this is a complete shot in the dark: are you sure both the Rust host triple and the installed LLVM have the same ISA? As in, you aren't trying to mix ARM and x86_64 code.

I don't know if this is your problem but I believe parts of llvm also requires a specific version of Python be installed and in PATH. Python 3.10 I think.

Got to the bottom of it. My fault. Stupidly didn’t realise that rust was building arm and I was using intel llvm.

1 Like