InitHeaderSeach defaultSystemIncludePaths

Hi,

I am trying to use the initHeaderSeach and initialize it with the default system include paths. On my installation, Fedora 10 the one of the system include path (needed for stdef.h) is not one of the listed in the initHeaderSeach. So In my code, I used the AddPath and now it works. Also on different version with 64 bit fedora 9, it is on /usr/lib/gcc/x86_64-redhat-linux/4.3.0/include

Below is a sample code:

InitHeaderSearch init(context.headers);
init.AddDefaultSystemIncludePaths(context.opts);
init.AddPath("/usr/lib/gcc/i386-redhat-linux/4.3.2/include/",
(InitHeaderSearch::IncludeDirGroup) 2, true, false, false);

Best regards,
Moataz

Hi,

I am trying to use the initHeaderSeach and initialize it with the default system include paths. On my installation, Fedora 10 the one of the system include path (needed for stdef.h) is not one of the listed in the initHeaderSeach. So In my code, I used the AddPath and now it works. Also on different version with 64 bit fedora 9, it is on /usr/lib/gcc/x86_64-redhat-linux/4.3.0/include

Hi Moataz,

Clang includes its own stddef.h file that it should fine relative to the path of the executable. Do you know why this isn't working?

-Chris

Hi Chris,

Sorry for the confusion, just to clarify, I am building a source transformer based on Clang. So I am doing a small example aside to better understand the Clang classes. (I have my own main, not using clang-cc.cpp)

As I look into clang-cc.cpp, I can see that Clang initializes the header search paths using the relative include path.
Eventually I will rely on clang-cc.cpp and have the transformation as a command line option.

Thanks,
Moataz