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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Ani Safaryan
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::vector<clang::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 <string>) and want
the program to output also the types specified in I do the following
modifications and get the following errors:
       
.........
std::vector<clang::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


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev