[cfe-dev] Issues with latest Clang Build

madil90 madil90 at gmail.com
Sat Nov 10 09:58:25 PST 2012


Hi,
   I just built the latest version of clang. I am creating an AST and
parsing it using my custom visitor. While creating the CompilerInstance
variable, I add the following code to search for C++ headers :

//HeaderSearchOptions headerSearch = TheCompInst.getHeaderSearchOpts();
    HeaderSearchOptions headerSearchOptions;

    
    // <Warning!!> -- Platform Specific Code lives here
    // This depends on A) that you're running linux and
    // B) that you have the same GCC LIBs installed. 
    vector<string> paths;
    paths.push_back("/usr/include/c++/4.7/x86_64-linux-gnu");
    paths.push_back("/usr/include/c++/4.7");
    paths.push_back("/usr/include/c++/4.7/backward");
    paths.push_back("/usr/local/include");
    paths.push_back("/usr/local/lib/clang/3.2/include");
    paths.push_back("/usr/include/x86_64-linux-gnu");
    paths.push_back("/usr/include");

    for (vector<string>::iterator begin = paths.begin()
                                , end = paths. end(); begin != end; begin++)
    {
        headerSearchOptions.AddPath(*begin,clang::frontend::CXXSystem,
false,false,true,true);
    }

    When I run my code on a file containing "#include <string>" or similar
libraries, it gives a number of errors like these, "error: use of undeclared
identifier '_atomic_fetch_add' ". How do I resolve this issue? It is ok if
the code is platform specific. 

Regards,
Adil



--
View this message in context: http://clang-developers.42468.n3.nabble.com/Issues-with-latest-Clang-Build-tp4028157.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list