[cfe-dev] New to Clang.

Manuel Klimek klimek at google.com
Thu Jun 19 05:01:37 PDT 2014


On Sun, Jun 15, 2014 at 2:49 PM, Sami Islam <sami_islam at hotmail.com> wrote:

> Hello,
> I am new to clang and need some guidance as to where to start.
>
> What I have done so far:
> 1. I have retrieved LLVM and CLang.
> 2. I have created a VS project using Cmake
> 3. I have built LLVM and Clang using Visual Studio 2013 and the project
> ALL_BUILD
>
> What I would like to do:
> I would like to use the CLang LibTooling library to start creating a
> refactoring tool.
>
> First try: I created a Visual Studio Project included all the header files
> according to the following link:
>
> http://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-ii-libtooling-example/
>

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)

Cheers,
/Manuel


>
>
> When I try to compile I get the error "Cannot open include file:
> 'clang/Driver/Options.inc': No such file or directory".
>
> I used the make file:
> ###################################################
> CLANG_LEVEL := ../..
>
> TOOLNAME = example  #the name of your tool's executable
>
> SOURCES := Example.cpp  #the Clang source files you want to compile
>
> include $(CLANG_LEVEL)/../../Makefile.config
>
> LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc
> option
>
> USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a \
>            clangTooling.a clangParse.a clangSema.a \
>            clangAnalysis.a clangRewriteFrontend.a clangRewriteCore.a \
>            clangEdit.a clangAST.a clangLex.a clangBasic.a
>
> include $(CLANG_LEVEL)/Makefile
> ###################################################
>
> Second try: I copied my example.cpp file under
> llvm\tools\clang\tools\example and used the GNUWin32 make.
> 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 makefile.config.in file. I
> renamed that to makefile.config.
> I kept getting errors like the following:
>
> Makefile.config:278: *** missing seperator.
> When I look at the makefile on line 278 I see the following:
>
> #################################################
> # 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
> #################################################
>
> If I uncomment line 277 it works but I get similar errors for other following lines.
>
> Question:
>
> Am I missing something?
>
> Thanks for any help you can provide.
>
> Kind regards
> Sami
>
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140619/45103cf3/attachment.html>


More information about the cfe-dev mailing list