Open darkdragon-001 opened 3 years ago
I'm guessing include-what-you-use
is not installed in the same directory as clang
?
I think the Clang code IWYU uses bases its search path on the executable path (that's basically incorrect, but convenient), so if they're in different roots, well, it's not going to work.
Both are installed with prefix /usr
as installed from Ubuntu repositories via apt
. So they should have exactly the same executable path...
What does which include-what-you-use
and which clang
(possibly with version suffix, e.g. clang-10) say on your system?
$ which clang
/usr/bin/clang
$ which include-what-you-use
/usr/bin/include-what-you-use
lrwxrwxrwx. 1 root root 24 Jan 14 15:39 /usr/bin/clang -> ../lib/llvm-11/bin/clang
lrwxrwxrwx. 1 root root 26 Jan 14 15:39 /usr/bin/clang++ -> ../lib/llvm-11/bin/clang++
lrwxrwxrwx. 1 root root 26 Jan 6 19:16 /usr/bin/clang++-11 -> ../lib/llvm-11/bin/clang++
lrwxrwxrwx. 1 root root 24 Jan 6 19:16 /usr/bin/clang-11 -> ../lib/llvm-11/bin/clang
Could you try putting include-what-you-use
in /usr/lib/llvm-11/bin/
and make the one in /usr/bin
a symlink, like clang?
I'm curious if that "fixes" this, because then it's definitely a case of issue 100 again.
I am using Ubuntu 21.04 with
clang
libc++-dev
andiwyu
package.While I can build via
I cannot
because of
It resides in
/usr/lib/llvm-11/include/c++/v1/
. Adding-I/usr/lib/llvm-11/include/c++/v1
explicitly solves the problem. I think this should not be necessary asclang++
is capable of resolving it itself as well.Might be related to #100