[cfe-dev] fatal error: 'algorithm' file not found

Csaba Raduly rcsaba at gmail.com
Sun Aug 24 01:36:32 PDT 2014

Hi Krish

On Sat, Aug 23, 2014 at 4:03 AM, Krishanthan Krishnamoorthy  wrote:
> Hi All,
> I tried the LibTooling example, and when I compile I got error like this :
> [root at localhost Clang-tutorial-master]# sudo make

1. You shouldn't build stuff as root.
2. If you are root, why are you using sudo ?

> clang++ -I/home/krishan/llvm/tools/clang/include
> -I/home/krishan/buildllvm/tools/clang/include -I/home/krishan/llvm/include
> -I/home/krishan/buildllvm/include  -D_DEBUG -D_GNU_SOURCE
> -fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions
> -fno-rtti -fPIC -Woverloaded-virtual -ffunction-sections -fdata-sections
> -Wcast-qual -fno-rtti   -c -o tutorial1.o tutorial1.cpp
> In file included from tutorial1.cpp:4:
> In file included from
> /home/krishan/llvm/include/llvm/Support/raw_ostream.h:17:
> /home/krishan/llvm/include/llvm/ADT/StringRef.h:13:10: fatal error:
> 'algorithm' file not found
> #include <algorithm>
>          ^
> 1 error generated.
> make: *** [tutorial1.o] Error 1

What operating system are you using?
If it's Linux, which distribution is it?
Where is clang++? Did you install a package or did you build it
yourself? If you built it yourself, did you run 'make install'

Run the compiler command from above but add the -v switch, like this:

clang++ -v -I/home/krishan/llvm/tools/clang/include
-I/home/krishan/llvm/include -I/home/krishan/buildllvm/include
-D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -std=c++11
-fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC
-Woverloaded-virtual -ffunction-sections -fdata-sections -Wcast-qual
-fno-rtti   -c -o tutorial1.o tutorial1.cpp

and show us the output.

GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

More information about the cfe-dev mailing list