<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Sun, Jun 15, 2014 at 2:49 PM, Sami Islam <span dir="ltr"><<a href="mailto:sami_islam@hotmail.com" target="_blank">sami_islam@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello,<br></div>I am new to clang and need some guidance as to where to start.<br><br></div><div>
What I have done so far:<br></div><div>1. I have retrieved LLVM and CLang.<br></div><div>2. I have created a VS project using Cmake<br>
</div><div>3. I have built LLVM and Clang using Visual Studio 2013 and the project ALL_BUILD<br><br></div><div>What I would like to do:<br></div><div>I would like to use the CLang LibTooling library to start creating a refactoring tool. <br>

<br>First try: I created a Visual Studio Project included all the header files according to the following link:<br><a href="http://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-ii-libtooling-example/" target="_blank">http://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-ii-libtooling-example/</a></div>
</div></blockquote><div><br></div><div>Yea, you cannot use the Makefile part of this tutorial - you'll need to use CMake to build it (you can just cargo cult the CMakeLists.txt from a different example directory and adapt it)</div>
<div><br></div><div>Cheers,</div><div>/Manuel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br>
<br></div><div>When I try to compile I get the error "Cannot open include file: 'clang/Driver/Options.inc': No such file or directory".<br><br></div><div>I used the make file:<br>###################################################<br>

<div><div><code>CLANG_LEVEL := ../..</code></div><div> </div><div><code>TOOLNAME = example  </code><code>#the name of your tool's executable</code></div><div>
 </div><div><code>SOURCES := Example.cpp  </code><code>#the Clang source files you want to compile</code></div><div> </div><div><code>include $(CLANG_LEVEL)/../..</code><code>/Makefile</code><code>.config</code></div>
<div> </div><div><code>LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option</code></div><div> </div><div><code>USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a \</code></div>
<div><code>           </code><code>clangTooling.a clangParse.a clangSema.a \</code></div><div><code>           </code><code>clangAnalysis.a clangRewriteFrontend.a clangRewriteCore.a \</code></div>
<div><code>           </code><code>clangEdit.a clangAST.a clangLex.a clangBasic.a</code></div><div> </div><div><code>include $(CLANG_LEVEL)</code><code>/Makefile</code></div>
</div>###################################################<br><br></div><div>Second try: I copied my example.cpp file under llvm\tools\clang\tools\example and used the GNUWin32 make.<br></div><div>I get the error that there is no Makefile.config in my llvm folder. I noticed that there isn't any but there is a <a href="http://makefile.config.in" target="_blank">makefile.config.in</a> file. I renamed that to makefile.config.<br>

</div><div>I kept getting errors like the following:<br><br></div><div>Makefile.config:278: *** missing seperator.<br></div><div>When I look at the makefile on line 278 I see the following:<br><pre style="font-family:Consolas;color:black;background:none repeat scroll 0% 0% white">
#################################################<br># When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
# into the "Release" directories. Otherwise, LLVM code is not optimized and
# output is put in the "Debug" directories.
#ENABLE_OPTIMIZED = 1
@ENABLE_OPTIMIZED@ -- Line 278<br>#################################################<br><br></pre><pre style="font-family:Consolas;color:black;background:none repeat scroll 0% 0% white">If I uncomment line 277 it works but I get similar errors for other following lines.<br>

<br></pre><pre style="font-family:Consolas;color:black;background:none repeat scroll 0% 0% white">Question:<br></pre><pre style="font-family:Consolas;color:black;background:none repeat scroll 0% 0% white">Am I missing something?<br>

<br></pre><pre style="font-family:Consolas;color:black;background:none repeat scroll 0% 0% white">Thanks for any help you can provide.<br><br></pre><pre style="font-family:Consolas;color:black;background:none repeat scroll 0% 0% white">
Kind regards<span class="HOEnZb"><font color="#888888"><br>Sami<br></font></span></pre><pre style="font-family:Consolas;color:black;background:none repeat scroll 0% 0% white"><br></pre><br></div><div><br><br></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>