<div dir="auto">Actually, how did you configure cmake? I experienced similar linker errors when building other external projects, and I suspect it might be down to using a different setup.</div><div class="gmail_extra"><br><div class="gmail_quote">On 22 Oct 2018 14:19, "Kristóf Umann" <<a href="mailto:dkszelethus@gmail.com">dkszelethus@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Cheers, glad it's solved!<br><div class="gmail_quote"><div dir="ltr">Lou Wynn <<a href="mailto:lewisurn@gmail.com" target="_blank">lewisurn@gmail.com</a>> ezt írta (időpont: 2018. okt. 22., H, 14:16):<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p><font size="+1">Nice, adding clangFrontend works! The tutorial
        needs an update.</font></p></div></blockquote><div>Yup, let's do it then. ;) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
    <p><font size="+1">Thanks.</font><br>
    </p>
    <pre class="m_-1451677776424910839m_-9003988622945461128moz-signature" cols="72">Love,
Lou</pre></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><pre class="m_-1451677776424910839m_-9003988622945461128moz-signature" cols="72"></pre>
    <div class="m_-1451677776424910839m_-9003988622945461128moz-cite-prefix">On 10/22/18 8:06 PM, Kristóf Umann
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Shouldn't it be this?:
        <div><font face="monospace, monospace">set(LLVM_LINK_COMPONENTS
            Support)<br>
            <br>
            add_clang_executable(loop-<wbr>convert<br>
              LoopConvert.cpp<br>
              )<br>
            target_link_libraries(loop-<wbr>convert<br>
              PRIVATE</font></div>
        <div><font face="monospace, monospace">  clangFrontend<br>
              clangTooling<br>
              clangBasic<br>
              clangASTMatchers<br>
              )  </font><br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">Lou Wynn <<a href="mailto:lewisurn@gmail.com" target="_blank">lewisurn@gmail.com</a>> ezt írta
          (időpont: 2018. okt. 22., H, 13:59):<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF">
            <p><font size="+1">I've already added. This is my
                CMakeLists.txt:</font></p>
            <p><tt><font size="+1">set(LLVM_LINK_COMPONENTS Support)<br>
                  <br>
                  add_clang_executable(loop-<wbr>convert<br>
                    LoopConvert.cpp<br>
                    )<br>
                  target_link_libraries(loop-<wbr>convert<br>
                    PRIVATE<br>
                    clangTooling<br>
                    clangBasic<br>
                    clangASTMatchers<br>
                    )<br>
                </font></tt><br>
            </p>
            <pre class="m_-1451677776424910839m_-9003988622945461128m_8640570513031577792moz-signature" cols="72">Love,
Lou

</pre>
            <div class="m_-1451677776424910839m_-9003988622945461128m_8640570513031577792moz-cite-prefix">On
              10/22/18 7:18 PM, Kristóf Umann wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Try adding <font face="monospace,
                  monospace">clangFrontend </font>to <span style="background-color:rgb(240,240,240);color:rgb(51,51,51)"><font face="monospace, monospace">target_link_libraries </font>in
                  <font face="monospace, monospace">CMakeLists.txt</font>.</span></div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr">Lou Wynn via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>
                  ezt írta (időpont: 2018. okt. 22., H, 12:14):<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div text="#000000" bgcolor="#FFFFFF">
                    <p><font size="+1">I followed the libTooling
                        tutorial at here: <a class="m_-1451677776424910839m_-9003988622945461128m_8640570513031577792m_-2790850193459753337moz-txt-link-freetext" href="http://clang.llvm.org/docs/LibASTMatchersTutorial.html" target="_blank">http://clang.llvm.org/docs/<wbr>LibASTMatchersTutorial.html</a>
                        to write the loop-convert program. When I built
                        it, I got the following error (I used the
                        unofficial monorepo to build clang):<br>
                      </font></p>
                    <p><tt><font size="+1"><br>
                        </font></tt></p>
                    <p><tt><font size="+1">$ ninja loop-convert<br>
                          [1/1] Linking CXX executable bin/loop-convert<br>
                          FAILED: : && /usr/bin/clang++-6.0  
                          -fPIC -fvisibility-inlines-hidden
                          -Werror=date-time
                          -Werror=unguarded-<wbr>availability-new -std=c++11
                          -Wall -Wextra -Wno-unused-parameter
                          -Wwrite-strings -Wcast-qual
                          -Wmissing-field-initializers -pedantic
                          -Wno-long-long -Wcovered-switch-default
                          -Wno-noexcept-type -Wnon-virtual-dtor
                          -Wdelete-non-virtual-dtor -Wstring-conversion
                          -fdiagnostics-color -fno-common
                          -Woverloaded-virtual -Wno-nested-anon-types
                          -g  -fuse-ld=lld-6.0 -Wl,--color-diagnostics
                          -Wl,-allow-shlib-undefined
tools/clang/tools/extra/loop-<wbr>convert/CMakeFiles/loop-<wbr>convert.dir/LoopConvert.cpp.o 
                          -o bin/loop-convert 
                          lib/libLLVMSupport.so.8svn -lpthread
                          lib/libclangTooling.so.8svn
                          lib/libclangBasic.so.8svn
                          lib/libclangASTMatchers.so.<wbr>8svn
                          -Wl,-rpath,"\$ORIGIN/../lib" && :<br>
                          /usr/bin/ld.lld-6.0: error: undefined symbol:
clang::PCHContainerOperations:<wbr>:PCHContainerOperations()<br>
                          >>> referenced by new_allocator.h:120
(/usr/bin/../lib/gcc/x86_64-<wbr>linux-gnu/5.4.0/../../../../<wbr>include/c++/5.4.0/ext/new_<wbr>allocator.h:120)<br>
                          >>>              
tools/clang/tools/extra/loop-<wbr>convert/CMakeFiles/loop-<wbr>convert.dir/LoopConvert.cpp.o:<wbr>(void
__gnu_cxx::new_allocator<<wbr>clang::PCHContainerOperations><wbr>::construct<clang::<wbr>PCHContainerOperations>(clang:<wbr>:PCHContainerOperations*))<br>
                          <br>
                          /usr/bin/ld.lld-6.0: error: undefined symbol:
                          vtable for clang::SyntaxOnlyAction<br>
                          >>> referenced by
                          FrontendActions.h:158
(/home/lu/work/git-repos/llvm-<wbr>mono/llvm-project/clang/<wbr>include/clang/Frontend/<wbr>FrontendActions.h:158)<br>
                          >>>              
tools/clang/tools/extra/loop-<wbr>convert/CMakeFiles/loop-<wbr>convert.dir/LoopConvert.cpp.o:<wbr>(clang::SyntaxOnlyAction::<wbr>SyntaxOnlyAction())<br>
                          <br>
                          /usr/bin/ld.lld-6.0: error: undefined symbol:
                          clang::FrontendAction::<wbr>FrontendAction()<br>
                          >>> referenced by
                          FrontendAction.h:253
(/home/lu/work/git-repos/llvm-<wbr>mono/llvm-project/clang/<wbr>include/clang/Frontend/<wbr>FrontendAction.h:253)<br>
                          >>>              
tools/clang/tools/extra/loop-<wbr>convert/CMakeFiles/loop-<wbr>convert.dir/LoopConvert.cpp.o:<wbr>(clang::ASTFrontendAction::<wbr>ASTFrontendAction())<br>
                          <br>
                          /usr/bin/ld.lld-6.0: error: undefined symbol:
                          vtable for clang::ASTFrontendAction<br>
                          >>> referenced by
                          FrontendAction.h:253
(/home/lu/work/git-repos/llvm-<wbr>mono/llvm-project/clang/<wbr>include/clang/Frontend/<wbr>FrontendAction.h:253)<br>
                          >>>              
tools/clang/tools/extra/loop-<wbr>convert/CMakeFiles/loop-<wbr>convert.dir/LoopConvert.cpp.o:<wbr>(clang::ASTFrontendAction::<wbr>ASTFrontendAction())<br>
                          clang: error: linker command failed with exit
                          code 1 (use -v to see invocation)<br>
                          ninja: build stopped: subcommand failed.</font></tt></p>
                    <p><tt><font size="+1"><br>
                        </font></tt></p>
                    <p><font size="+1">Can anyone point me to the right
                        direction to fix it?</font></p>
                    <p><font size="+1">Thanks.<br>
                      </font></p>
                    <pre class="m_-1451677776424910839m_-9003988622945461128m_8640570513031577792m_-2790850193459753337moz-signature" cols="72">-- 
Love,
Lou

</pre>
                  </div>
                  ______________________________<wbr>_________________<br>
                  cfe-dev mailing list<br>
                  <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
                  <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
                </blockquote>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </div>

</blockquote></div></div>
</blockquote></div></div>