<html>
<head></head>
<body>
<p>Thank you very much David,</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br/>
<p><a href="http://clang.llvm.org/docs/JSONCompilationDatabase.html" target="_blank">http://clang.llvm.org/docs/JSONCompilationDatabase.html</a> might provide some help.</p>
</blockquote><p> This really worked.</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>After this, I tried to follow this other tutorial:<br/>
ttp://clang.llvm.org/docs/RAVFrontendAction.html</p>
<p>As in Step1, I put FindClassDecls.cpp in a directory called find-class-decls<br/>
in ~/clang-llvm/llvm/tools/clang/tools andc hanged the CMakeLists.txt in<br/>
tools. Then, I run ninja in ~/clang-llvm/build and I get the next error:</p>
<p>/home/pedro/clang-llvm/llvm/tools/clang/tools/find-class-decls/FindClassDecls.cpp:17:43:<br/>
error: member access into incomplete type 'clang::ASTContext'</p>
</blockquote><p>Looks like it needs "ASTContext.h" included.</p>
</blockquote><p>I included clang/AST/ASTContext.h and i have now another kind of probem, as it can't find anything:</p>
<p><em>tools/clang/tools/find-class-decls/CMakeFiles/find-class-decls.dir/FindClassDecls.cpp.o:(.data.rel.ro._ZTV20FindNamedClassAction[_ZTV20FindNamedClassAction]+0x14): undefined reference to `clang::ASTFrontendAction::ExecuteAction()'</em></p>
<p><em>... ...</em></p>
<p><em>tools/clang/tools/find-class-decls/CMakeFiles/find-class-decls.dir/FindClassDecls.cpp.o:(.data.rel.ro._ZTV22FindNamedClassConsumer[_ZTV22FindNamedClassConsumer]+0x28): undefined reference to `clang::ASTConsumer::HandleTopLevelDeclInObjCContainer(clang::DeclGroupRef)'</em></p>
<p><em>... ...</em></p>
<p><em>clang-3.3: error: linker command failed with exit code 1 (use -v to see invocation)</em><br /><em>ninja: build stopped: subcommand failed.</em><br /><br /></p>
<p>What can I do? I'm not able to understand this error.</p>
<p>Thanks again,</p>
<p>Pedro</p>
<br/>
<br/>
<div><em>El dia 15 abr 2013 07:53, David Blaikie <dblaikie@gmail.com> escribió:</em></div><blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>On Fri, Apr 12, 2013 at 4:18 AM, Pedro Delgado Perez<br/>
<pedro.delgadoperez@mail.uca.es> wrote:</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>Hello everyone,</p>
<p>To get started with Clang, I'm trying to reproduce the examles in tutorial.<br/>
I began with:</p>
<p><a href="http://clang.llvm.org/docs/LibASTMatchersTutorial.html" target="_blank">http://clang.llvm.org/docs/LibASTMatchersTutorial.html</a></p>
<p>I accomplished Step 0 and 1 without any problems, but I had trouble with<br/>
Step 2.<br/>
1. The directory ~/clang-llvm/llvm/llvm_build doesn't exist. So, I tried to<br/>
rerun ninja in ~/clang-llvm/build as I did in Step 1, but it says: "ninja:<br/>
no work to do"<br/>
How can I recompile LoopConvert?</p>
</blockquote><p>I assume "llvm_build" is a mistype and it should be<br/>
~/clang-llvm/build. Are you sure you followed the steps in (1) to<br/>
change the CMakeLists.txt file, for example?</p>
<p>If you're not sure how to /rebuild/ - that should happen<br/>
automatically, if you make any changes. If it's not rebuilding, try<br/>
editing the source files and running the ninja command again.</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>2. If I run now bin/loop-convert test.cpp as in Step1, it says:<br/>
LLVM ERROR: Could not auto-detect compilation database for file "test.cpp"<br/>
No compilation database found in /home/pedro/clang-llvm/build or any parent<br/>
directory<br/>
json-compilation-database: Error while opening JSON database: No such file<br/>
or directory</p>
<p>What's the problem now? What have changed?</p>
</blockquote><p><a href="http://clang.llvm.org/docs/JSONCompilationDatabase.html" target="_blank">http://clang.llvm.org/docs/JSONCompilationDatabase.html</a> might provide some help.</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>After this, I tried to follow this other tutorial:<br/>
ttp://clang.llvm.org/docs/RAVFrontendAction.html</p>
<p>As in Step1, I put FindClassDecls.cpp in a directory called find-class-decls<br/>
in ~/clang-llvm/llvm/tools/clang/tools andc hanged the CMakeLists.txt in<br/>
tools. Then, I run ninja in ~/clang-llvm/build and I get the next error:</p>
<p>/home/pedro/clang-llvm/llvm/tools/clang/tools/find-class-decls/FindClassDecls.cpp:17:43:<br/>
error: member access into incomplete type 'clang::ASTContext'</p>
</blockquote><p>Looks like it needs "ASTContext.h" included.</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>FullSourceLoc FullLocation =<br/>
Context->getFullLoc(Declaration->getLocStart());<br/>
^<br/>
/home/pedro/clang-llvm/llvm/tools/clang/include/clang/AST/ASTConsumer.h:18:9:<br/>
note: forward declaration of 'clang::ASTContext'<br/>
class ASTContext;<br/>
^<br/>
/home/pedro/clang-llvm/llvm/tools/clang/tools/find-class-decls/FindClassDecls.cpp:36:33:<br/>
error: member access into incomplete type 'clang::ASTContext'<br/>
Visitor.TraverseDecl(Context.getTranslationUnitDecl());<br/>
^<br/>
/home/pedro/clang-llvm/llvm/tools/clang/include/clang/AST/ASTConsumer.h:18:9:<br/>
note: forward declaration of 'clang::ASTContext'<br/>
class ASTContext;<br/>
^<br/>
2 errors generated.</p>
<br/>
<br/>
<p>What's happening here?</p>
<br/>
<p>Thanks in advance.</p>
<p>Pedro.</p>
<p>PD; By the way, LoopPrinter class in<br/>
<a href="http://clang.llvm.org/docs/LibASTMatchersTutorial.html" target="_blank">http://clang.llvm.org/docs/LibASTMatchersTutorial.html</a> lacks a '}' before<br/>
'};'</p>
<br/>
<p>_______________________________________________<br/>
cfe-dev mailing list<br/>
cfe-dev@cs.uiuc.edu<br/>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></p>
</blockquote></blockquote>
</body>
</html>