KyleMayes / clang-sys

Rust bindings for libclang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clang-sys not finding libclang when PATH is too precise

mundusnine opened this issue · comments

I recently encountered this issue and the problem was that the path in the windows PATH was directly pointing to libclang.

The issue: the clang-sys error only returned that it did not find libclang. For the user it is hard to know what the error is when the path to file is directly specified in the PATH. I now know that it is because clang-sys was trying to find a folder with the dll's and not the .dll directly.

Solutions(as discussed in the issue):

  • clang-sys should return an error that states the path is a file and that it was looking for a directory

  • Or alternatively making clang-sys detect it's a file and accept the path as valid to get the dll

Handling the case where LIBCLANG_PATH points to the library rather than a directory containing the library seems reasonable, I will try to fix this over the weekend.

You can now use LIBCLANG_PATH to specify a specific libclang instance rather than just a search directory.

Sorry for the delay.