<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59346>59346</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Tools do not explain how to link clang lib files
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          miss-programgamer
      </td>
    </tr>
</table>

<pre>
    The various tools that [this page](https://clang.llvm.org/docs/LibTooling.html) recommends we use as examples on how to link against the clang lib files do not actually do so. For instance, in clang-check, neither `add_clang_tool` nor `clang_target_link_libraries` are explained, and nothing indicates which cmake file need to be included to make those functions available.

When I try to follow the example linked above, I get a linker error telling me that symbols relating to clang tooling (such as the `CommonOptionsParser` constructor) are unresolved, yet I can't figure out how to link against the various clang lib files that the project needs.

I realize this might not be the best place to ask this, but I'm not sure where else to go considering how massive of a project LLVM is.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VE2P4zYM_TXKhZjAI8f5OPiwu4MAAaZoD4P2OKAl2lJHlgKRTjb99YWU7BazQC8JLD5Kj--RRGY_RaJedV9V97LCRVzK_eyZn845TRnnCWfKqyHZW__mCC6YfVoYJKXAIA4FVPdVnGc440Sqe1F670TOrNovSh-VPpqAcVqHcJnXKU9KH20yrPTx1Q9vKQUfp7WTOSh9gEwmzTNFy3AlWJgAGeg7zudADCmCS1eQBMHHD8AJfWQBcQT1DQh-gNEXqE0QkwAaWTCEW_nmtIZjylByMBpS-hv4eM98Mo7MRzmJ5MVRBrVt0Nr3Gn0vxaptAzHVwOMQ80TyXqi8Bz9kzJ64oDAT0PdzQB_Jljsx2sLG-TiBj9YbFGK4Om8cmBk_qJKGSGRLcQOBjyYs9v5ZAeISE4xLNOJTZMAL-oBDoLVqXlTz5f77l6MIJ5B8K4ljCqHI5eiHhFU3soBDutT6TzCRAN7PM1DOKYNQKKbATHd_-TYPxexMAaUEJD30lrt9oPSeF-OKWeU1tW2-pXlO8fdzZfsHZqZcpDEpsuTFSMrF7qLUEjNxCpe7VDcSOIHBqPROYPTTkgnSIv9r_I9-_LUBKvMCOOf0Nxmp6vIntU6QCYP_p5TpGWY_OaldM1DNHIgFzgENlZeRPyqusBwWgZPSu7nCuXC8Oiq2B67gKdVSvaVc9Cnk5zJrF4I0Av4k9fr652_geb2yfWsP7QFX1D9vd43ePe_37cr1Y6u3o9k2h9but8PWjjtzeD48bzbWjmO72698rxutn3XT6UZvNnq922HT7ru26w5t1xmrNg3N6MPPAVx55oX67tButquAAwWu4691pCvUoNK6bIPcl5ynYZlYbZrgWfi_W8RLoP6troHHtD2a_pNXv_iyWnLoP6-HyYtbhrVJs9LHcv3j7-khktLHSqqsjEr63wAAAP__kqmd1A">