title: Library not linking and getting undefined reference to `Lib::algorithmA(int const&)' errior
body: <p>I'm pulling all my code from my instructor that should be compiling but it seems that my library file is not being linked correctly so the file runs as undefined.</p>
  <p>My main file runs in src and looks like this with a lot of unused include statements after the # include &lt;Lib.h&gt; statement.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;Lib.h&gt;
  #include &quot;Lib.h&quot;
  #include &quot;../include/Lib.h&quot;
  //#include &quot;../lib/libalgos-win.a&quot;
  
  using namespace std;
  
  int main() {
      //you must change/expand this code
      int n = 20;
      //Lib guy = new Lib();
      Lib::algorithmA(n);
      cout &lt;&lt; &quot;Successful execution&quot; &lt;&lt;endl;
      return 0;
  }
  </code></pre>
  <p>My Lib.h file looks like the following</p>
  <pre><code>#ifndef LIBRARY_LIB_H
  #define LIBRARY_LIB_H
  
  
  
  class Lib {
  public:
      static void algorithmA(const int&amp; n);
      static void algorithmB(const int&amp; n);
      static void algorithmC(const int&amp; n);
  };
  
  
  #endif //LIBRARY_LIB_H
  </code></pre>
  <p>In my Cmake file I have the following code:</p>
  <pre><code>target_link_libraries(a2-program &quot;${PROJECT_SOURCE_DIR}/lib/libalgos-win.a&quot;)
  </code></pre>
  <p>This should, in theory, link the library file to the library I have in lib but instead, I'm getting an error about the reference not being defined. He didn't give more instructions on how to edit the code so I'm completely lost.</p>