title: clang: error: linker command failed with exit code 1 (use -v to see invocation) when using CMakelist
body: <p>I created a simple C++ program. I am getting the linked error. The code is below.</p>
  <p><strong>main.cxx</strong></p>
  <pre><code>#include &lt;iostream&gt;
  #include &quot;test.hxx&quot;
  
  int main(void)
  {
      testns::testBuff&lt;int, 10&gt; bufferObj;
      bufferObj.reset();
      return 0;
  }
  </code></pre>
  <p><strong>test.cxx</strong></p>
  <pre><code>#include &lt;array&gt;
  #include &lt;unistd.h&gt;
  #include &quot;test.hxx&quot;
  
  namespace testns
  {
  
  template &lt;class T, size_t TSize&gt;
  void testBuff&lt;T, TSize&gt;::reset()
  {
      //reset
  }
  } //namespace testns
  </code></pre>
  <p><strong>test.hxx</strong></p>
  <pre><code>namespace ringbuff
  {
  
  template &lt;class T, size_t TSize&gt;
  class testBuff
  {
   public:
      explicit testBuff() = default;
      void   reset();
  };
  } //namespace testns
  </code></pre>
  <p><strong>CMakeLists</strong></p>
  <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.8.2)
  
  SET(CMAKE_CXX_STANDARD 20)
  SET(CMAKE_CXX_STANDARD_REQUIRED ON)
    
  STRING(TOLOWER ${PROJECT_NAME} PROJECT_EXE_NAME)
   
  SET(DIR_WORKSPACE ${PROJECT_SOURCE_DIR}/..)
   
  SET(DIR_TB ${DIR_WORKSPACE}/TestBuffer)
  SET(DIR_TB_INCLUDE ${DIR_TB}/include)
  SET(DIR_TB_SRC ${DIR_TB}/src)
   
  file (GLOB_RECURSE ALL_TB_CPP_FILES ${DIR_TB_SRC}/*.cxx)
  
  SET(CMAKE_CXX_ARCHIVE_CREATE &quot;&lt;CMAKE_AR&gt; crP &lt;TARGET&gt; &lt;OBJECTS&gt;&quot;)
  SET(CMAKE_CXX_ARCHIVE_APPEND &quot;&lt;CMAKE_AR&gt; rP &lt;TARGET&gt; &lt;OBJECTS&gt;&quot;)
   
  ADD_EXECUTABLE(${PROJECT_EXE_NAME}
                 ${ALL_TB_CPP_FILES}
                 )
                 
  TARGET_INCLUDE_DIRECTORIES(
      ${PROJECT_EXE_NAME} PUBLIC
      ${DIR_TB_INCLUDE}
      ${CMAKE_BINARY_DIR}/include
      ${CMAKE_INSTALL_PREFIX}/include
  )
   
  TARGET_COMPILE_OPTIONS(
      ${PROJECT_EXE_NAME}
    PRIVATE
      -fvisibility=hidden
      -pipe
      -Wall
      -Werror
      -Wextra
      -Wfloat-conversion
      -Wformat
      -Wformat-security
      -Werror=format-security
  )
   
  TARGET_LINK_LIBRARIES(
      ${PROJECT_EXE_NAME}
      ${log-lib}
      )
      
  </code></pre>
  <blockquote>
  <p>Error: Linker Error clang: error: linker command failed with exit code
  1 (use -v to see invocation) make[2]: ***
  [CMakeFiles/project.dir/build.make:114: project] Error 1 make[1]: ***
  [CMakeFiles/Makefile2:73: CMakeFiles/project.dir/all] Error 2 make:
  *** [Makefile:84: all] Error 2</p>
  </blockquote>
  <p>I am using the clang compiler. Can someone help me what I am missing and why there is a linker error?</p>
  <p>Thank you</p>