title: error LNK2019: unresolved external symbol in a multiple projects solution
body: <p>I have a visual studio solution with multiple projects. One of them, "MyProject" is a static library (.lib). The project, among many other classes has two classes "A" and "B". </p>
  
  <p>A.h:</p>
  
  <pre><code>#pragma once
  
  class A
  {
  public:
      void foo();
  };
  </code></pre>
  
  <p>A.cpp:</p>
  
  <pre><code>#include A.h
  
  void A::foo(){
          //do something
  }
  </code></pre>
  
  <p>B.h:</p>
  
  <pre><code>#pragma once
  
  class B
  {
  public:
      void bar();
  };
  </code></pre>
  
  <p>B.cpp:</p>
  
  <pre><code>#include B.h
  #include A.h
  
  void B::bar(){
          A a;
          a.foo();
  }
  </code></pre>
  
  <p>Without compilation errors I'm getting the linkage error:</p>
  
  <blockquote>
    <p>OtherProject.lib(B.obj) : error LNK2019: unresolved external symbol "public: void __thiscall
    A::foo(void)" (?foo@A@@QAE_NXZ) referenced in function "public: void
    __thiscall B::bar(void)" (?bar@B@@QAEXXZ)</p>
  </blockquote>
  
  <p>Everything seems to be fine. I do see the compilation process of A.cpp. Building or linking only the project "MyProject" is fine. But when trying to build the whole solution I'm getting the error.</p>
  
  <p>Thanks!</p>