[cfe-dev] 'Header file not found' error during clang source to source transformation

Manuel Klimek klimek at google.com
Fri Jun 20 00:16:01 PDT 2014


Yea, I argued with chandler for a long time that we should just put the
internal headers into the tools (compile them in), but was not able to
convince him (yet).

Cheers,
/Manuel


On Fri, Jun 20, 2014 at 5:10 AM, Joshua Cranmer 🐧 <Pidgeot18 at gmail.com>
wrote:

>  On 6/19/2014 2:46 PM, Sandeep K Chaudhary wrote:
>
> Hi guys,
>
>  I am doing some basic source to source transformation by iterating
> through the AST using Clang front-end. And, it is working fine i.e. I am
> able to get transformed code with insertions.
>
>  However, when I have some header file inclusions in the input source
> code such as "#include<stdio.h", it produces an error message when
> transforming the code. It is -
>
>  *input.c:1:9: fatal error: 'stdio.h' file not found*
> *#include<stdio.h>*
> *        ^*
>  So my question is - how can I avoid getting this error about header
> files? For all practical use, my input source files will have the header
> files. Please let me know.
>
>
> This is a well-known issue that is unfortunately documented extremely
> poorly (or, rather, the documentation does absolutely nothing to call out
> what is arguably the single most common failure beyond "I'm missing -I or
> -l in my compile commands").
>
> The short version: drop your tool in /usr/local/bin and run it from there.
>
> The longer version: in the absence of specific options indicating
> otherwise, the lookup for files usually found in places under /usr is done
> using $(dirname argv[0])/../lib/clang/<version>/include and similar paths.
>
> --
> Joshua Cranmer
> Thunderbird and DXR developer
> Source code archæologist
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140620/e910e066/attachment.html>


More information about the cfe-dev mailing list