<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 6/19/2014 2:46 PM, Sandeep K
Chaudhary wrote:<br>
</div>
<blockquote
cite="mid:CAEEAEzUAwJXehPEx+7ptXvSJ4hr2qw02KXueNufm+hBGg+p3+Q@mail.gmail.com"
type="cite">
<div dir="ltr">Hi guys,
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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 -</div>
<div><br>
</div>
<div>
<div><b>input.c:1:9: fatal error: 'stdio.h' file not found</b></div>
<div><b>#include<stdio.h></b></div>
<div><b> ^</b></div>
</div>
<div>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.</div>
<div><br>
</div>
</div>
</blockquote>
<br>
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").<br>
<br>
The short version: drop your tool in /usr/local/bin and run it from
there.<br>
<br>
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.<br>
<br>
<pre class="moz-signature" cols="72">--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist</pre>
</body>
</html>