How to make clang recognize the system files included in a C++ source file?

Hello all,

I am writing a simple program which outputs the C++ types specified in the
source file. When I include a user-defined header file in my source file and
want the program to output the types specified in it I add the following:

std::vectorclang::DirectoryLookup v;
std::string s = “/path for the header file/”;
const clang::DirectoryEntry* d = m_file_manager.getDirectory(s);
v.push_back(clang::DirectoryLookup(d, clang::SrcMgr::C_User, true, false));
clang::HeaderSearch m_header_search.SetSearchPaths(v, 0, 0);

When I include system file in my source file(e.g #include ) and want
the program to output also the types specified in I do the following
modifications and get the following errors:


std::vectorclang::DirectoryLookup v;
std::string s = “/path for the header file/”;
const clang::DirectoryEntry* d = m_file_manager.getDirectory(s);
v.push_back(clang::DirectoryLookup(d, clang::SrcMgr::C_User, true, false));
clang::HeaderSearch m_header_search.SetSearchPaths(v, 0, 0);

Stack dump:
0. /usr/include/c++/4.3/iosfwd:133:3: current parser token ‘typedef’

Note InitHeaderSearch.h is not available in my clang version.

Regards,
Ani