[cfe-dev] HeaderSearch
Ilya Mirsky
ilya.mirsky at gmail.com
Thu Mar 17 04:55:43 PDT 2011
Hi,
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:
tests
#include <...> search starts here:
/usr/local/include
/usr/include
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,
Ilya
--
Ilya Mirsky
www.cs.bgu.ac.il/~mirskyil <http://www.cs.bgu.ac.il/%7Emirskyil>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110317/9f0575cc/attachment.html>
More information about the cfe-dev
mailing list