Unable to find libclang: "the `libclang' issue

I am trying to build godot-rust

And I am having some issues on Windows 10.

I installed LLVM, I downloaded version 13

https://releases.llvm.org/

Yet I am still having some issues. I had this error:

  thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library
at ​C:/msys64/mingw64\\bin\\libclang.dll could not be opened: LoadLibraryExW failed"'

adsI am trying to build godot-rust

And I am having some issues on Windows 10.

I installed LLVM, I downloaded version 13

https://releases.llvm.org/

Yet I am still having some issues. I had this error:

  thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library
at ​C:/msys64/mingw64\\bin\\libclang.dll could not be opened: LoadLibraryExW failed"'

I am not too sure why this is happening. I even ran clang -v to make sure it is installed and I am getting an output.

Did you set the LIBCLANG_PATH env var to the bin dir of the llvm installation?

Windows

Download and install the official pre-built binary from LLVM download page.

You will also need to set LIBCLANG_PATH as an environment variable pointing to the bin directory of your LLVM install. For example, if you installed LLVM to D:\programs\LLVM , then you'd set the value to be D:\programs\LLVM\bin .

Alternatively, for Mingw64, you can install clang via

pacman -S  mingw64/mingw-w64-x86_64-clang
1 Like

Under Linux I could solve it by installing the libclang-dev dependency. I had a similar issue when building Enzyme.
But not sure how the situation is under Windows:

1 Like

My solution was I uninstalled it from the pacman manager form Msys2 and then I installed the official one fromt he download page and it works, thanks :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.