My clang does not find basic header files like <algorithm>
. According to this post I have to install the libstdc++
via yum install gcc-c++
. On my machine libstdc++
is already present but in a different folder. How can I tell clang to search in that folder?
Clang output:
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib64/clang/6.0.1/include
/usr/include
End of search list.
throughput_benchmark.cpp:1:10: fatal error: 'algorithm' file not found
#include <algorithm>
^~~~~~~~~~~
Some of the dirs:
find / -name "libstdc++*"
/usr/lib64/libstdc++.so.6.0.24
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so
/usr/lib64/libstdc++.so.6.0.19
/etc/alternatives/libstdc++.so
I am using clang version 6.0.1
on Red Hat Enterprise Linux (RHEL).
When passing custom include paths, I seem to be able to compile, but I get linker command failed with
exit code 1 (cannot find crtbegin.o),
even though that is included in one of the custom include paths and the are also included with -L/path/to/lib
.