<div dir="ltr">Hi,<br><br>I'm having a problem with HeaderSearch.<br>I need to add a custom path to search in, but If I do so it seems clang is unable to find the standard headers.<br><br>This is the initialization code:<br>
<br><div style="margin-left: 40px;"> _hsOpts->UseStandardIncludes = 1;<br> _hsOpts->UseBuiltinIncludes = 1;<br> _hsOpts->UseStandardCXXIncludes = 1;<br> _hsOpts->Verbose = 1;<br><br> _hsOpts->AddPath(headersPath, frontend::Quoted, true, false, true);<br>
<br> ApplyHeaderSearchOptions(*_hs, *_hsOpts, _langOpts, *_triple);<br><br> InitializePreprocessor(*_pp, *_ppOpts, *_hsOpts, *_fendOpts);</div><div><div style="margin-left: 40px;"><br></div>After this code is executed, clang ignores standard C library functions, such as malloc.<br>
If I don't execute this code, then malloc do recognized.<br><br>The output of verbose is:<br><br><div style="margin-left: 40px;">ignoring nonexistent directory "/include"<br>#include "..." search starts here:<br>
tests<br>#include <...> search starts here:<br> /usr/local/include<br> /usr/include<br>End of search list.<br><br></div>So it does search in /usr/include and should locate stdlib.h and etc..<br>Adding the path /usr/include mannually isn't working either.<br>
<div><br>What am I doing wrong here?<br><br><br>Thanks in advance,<br>Ilya<br><div><br clear="all"><br>-- <br><div dir="ltr"><span style="color: rgb(153, 153, 153); font-family: arial,helvetica,sans-serif;">Ilya Mirsky</span><br style="color: rgb(153, 153, 153); font-family: arial,helvetica,sans-serif;">
<a style="color: rgb(153, 153, 153); font-family: arial,helvetica,sans-serif;" href="http://www.cs.bgu.ac.il/%7Emirskyil" target="_blank">www.cs.bgu.ac.il/~mirskyil</a><br></div><br>
</div></div></div></div>