I’m having a problem with HeaderSearch.
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.
This is the initialization code:
_hsOpts->UseStandardIncludes = 1;
_hsOpts->UseBuiltinIncludes = 1;
_hsOpts->UseStandardCXXIncludes = 1;
_hsOpts->Verbose = 1;
_hsOpts->AddPath(headersPath, frontend::Quoted, true, false, true);
ApplyHeaderSearchOptions(*_hs, *_hsOpts, _langOpts, *_triple);
InitializePreprocessor(*_pp, *_ppOpts, *_hsOpts, *_fendOpts);
After this code is executed, clang ignores standard C library functions, such as malloc.
If I don’t execute this code, then malloc do recognized.
The output of verbose is:
ignoring nonexistent directory “/include”
#include “…” search starts here:
#include <…> search starts here:
End of search list.
So it does search in /usr/include and should locate stdlib.h and etc…
Adding the path /usr/include mannually isn’t working either.
What am I doing wrong here?
Thanks in advance,