one of the example program doesn't compiling

Updated versions of this tutorial can be found at:


Hi Robert,

Thank-you for the link. I tried to compile that tutorial files, but I am getting following error.

tutorial1.cpp:55:13: error: reference to type ‘const std::shared_ptr’ could not
bind to an rvalue of type 'clang::TargetOptions *'
/home/krish/llvm/tools/clang/include/clang/Basic/TargetInfo.h:99:58: note: passing argument to
parameter ‘Opts’ here
const std::shared_ptr &Opts);
tutorial1.cpp:68:25: error: no matching constructor for initialization of 'clang::Preprocessor’
clang::Preprocessor preprocessor(
/home/krish/llvm/tools/clang/include/clang/Lex/Preprocessor.h:451:3: note: candidate constructor
not viable: no known conversion from ‘clang::TargetInfo *’ to ‘clang::SourceManager &’ for
4th argument
Preprocessor(IntrusiveRefCntPtr PPOpts,
/home/krish/llvm/tools/clang/include/clang/Lex/Preprocessor.h:88:7: note: candidate constructor
(the implicit copy constructor) not viable: requires 1 argument, but 7 were provided
class Preprocessor : public RefCountedBase {
2 errors generated.
make: *** [tutorial1.o] Error 1

Actually, this tutorial will help me to achieve my goal, so I really want to test it.