[LLVMdev] Query regarding LLVM library for compilation
jtcriswel at gmail.com
Mon Oct 27 06:53:50 PDT 2014
The LLVM and Clang header files #include other LLVM and Clang header
files. Therefore, when compiling your code with gcc or clang, you need
to add the -I option to tell the compiler where to find these header
files. The -I option can be used multiple times to specify multiple
locations for which to look for header files.
For example, if a header file is located in /u/criswell/foo/bar.h, then
adding -I/u/criswell to the gcc/clang command line will allow me to use
#include <foo/bar.h> in my source code.
The reason why your code compiles when added to the LLVM/Clang source
trees is that the LLVM Makefiles add the appropriate -I options for you.
On 10/24/14, 9:55 PM, Nitin Mukesh Tiwari wrote:
> Dear LLVM Team
> I have installed LLVM and have also tried of using examples for
> learning LLVM.
> I am really sorry if this is a silly question but I tried writing one
> file for clang++ which uses some header file from LLVm nad clang like
> I could not compile as the error was thrown that verifier.h not found
> even when I have the exact path. But when I put my file in example
> folder and made changes to makefile and build the examples by running
> make file everything just worked fine. My query is is ther any way
> that my system automatically finds the header for LLVm and clang
> whenever I use them like it does for stdio.h and iostream.h or I need
> to build the example again and again ?
> Thanks and Regards
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
Department of Computer Science, University of Rochester
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev