[LLVMdev] Fatal error in build, include <utility> not found

Charles Davis cdavis5x at gmail.com
Thu Jan 3 08:44:43 PST 2013

On Jan 3, 2013, at 6:50 AM, APaschos wrote:
> llvm[2]: Compiling GCDAProfiling.c for Release+Asserts build (PIC)
Well here's your problem! You're trying to include a C++ header (your custom header, "llvm/Support/myfile.hpp") from a C header (<llvm/Support/DataTypes.h>). There are a couple of ways you could solve this: either don't include your custom header from DataTypes.h, or guard it with an #ifdef __cplusplus block.


> In file included from
> /home/user/LLVM/llvm-3.1.src/runtime/libprofile/GCDAProfiling.c:23:
> In file included from
> /home/user/LLVM/build/include/llvm/Support/DataTypes.h:74:
> /home/user/LLVM/llvm-3.1.src/include/llvm/Support/myfile.hpp:81:10: fatal
> error: 'utility' file not found
> #include <utility>
>         ^
> 1 error generated.

More information about the llvm-dev mailing list