[LLVMdev] including llvm headers in the sample project

Eric Soderstrom e_k_s at mit.edu
Wed Jul 16 14:13:02 PDT 2014


When building an llvm project, I followed the steps outlined here:
http://llvm.org/docs/Projects.html and copied the sample project from
/projects/sample.

This compiles just fine. However, when I try to include llvm headers,
compilation fails with the error:

In file included from /home/eks/projects/cfg/tools/cfg/main.c:9:
In file included from
/home/eks/projects/llvm/llvm-svn/include/llvm/Module.h:18:
In file included from
/home/eks/projects/llvm/llvm-svn/include/llvm/Function.h:21:
In file included from
/home/eks/projects/llvm/llvm-svn/include/llvm/GlobalValue.h:21:
In file included from
/home/eks/projects/llvm/llvm-svn/include/llvm/Constant.h:17:
In file included from
/home/eks/projects/llvm/llvm-svn/include/llvm/User.h:22:
In file included from
/home/eks/projects/llvm/llvm-svn/include/llvm/Support/ErrorHandling.h:19:
In file included from
/home/eks/projects/llvm/llvm-svn/include/llvm/ADT/StringRef.h:13:
/home/eks/projects/llvm/llvm-svn/include/llvm/Support/type_traits.h:21:10:
fatal error: 'cstddef' file not found
#include <cstddef>


It seems that when trying to include llvm headers, compilation always
fails, citing various missing c++ system headers.

How does one include llvm headers in the sample project without running in
to this problem?

also, is autoconf really the best way to be building llvm projects? It
seems like most projects use cmake instead, but I wasn't able to find llvm
documentation for setting up a sample project with cmake.
thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140716/2ea6498a/attachment.html>


More information about the llvm-dev mailing list