title: LNK2028 and LNK2019 error when using dll with no inline code
body: <p>This is the first time I'm using .NET and its giving me hard time when using more than one project. What am I doing wrong? This is what I did:</p>
  
  <p>1 Create a new project (and solution). A "Class Library" called "Lib".</p>
  
  <p>2 Add file "Comp1.h" to "Header Files" with the following code:</p>
  
  <pre><code>#ifndef COMP1_H
  #define COMP1_H
  class comp1
  {
  public:
      comp1(void);
      ~comp1(void);
  }
  #endif
  </code></pre>
  
  <p>3 Add file "Comp1.cpp" to "Source Files" with the following code:</p>
  
  <pre><code>#include "stdafx.h"
  #include "Comp1.h"
  comp1::comp1(void){}
  comp1::~comp1(void){}
  </code></pre>
  
  <p>4 I overwrite the code of the automatically created "Lib.h" file with:</p>
  
  <pre><code>#ifndef LIB_H
  #define LIB_H
  #include "Comp1.h"
  #endif
  </code></pre>
  
  <p>5 Add a "CLR empty project" called "Test" and set it as start-up project.</p>
  
  <p>6 Add file "test.cpp" to "Source Files" of the "Test" project with the following code:</p>
  
  <pre><code>#include "../Lib/Lib.h"
  #using "../Debug/Lib.dll"//Is this line mandatory?
  int main()
  {
  comp1 component;
  return 0;
  }
  </code></pre>
  
  <p>7 Add "Lib" as a reference in the "Test" properties.</p>
  
  <p>8 Make sure in "Project Dependencies" that "Test" depends on "Lib".</p>
  
  <p>9 Compile them both as /clr</p>
  
  <p>This is what I get:</p>
  
  <pre><code>1&gt;test.obj : error LNK2028: unresolved token (0A000009) "public: __thiscall comp1::comp1(void)" (??0comp1@@$$FQAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
  1&gt;test.obj : error LNK2028: unresolved token (0A00000A) "public: __thiscall comp1::~comp1(void)" (??1comp1@@$$FQAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
  1&gt;test.obj : error LNK2019: unresolved external symbol "public: __thiscall comp1::~comp1(void)" (??1comp1@@$$FQAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
  1&gt;test.obj : error LNK2019: unresolved external symbol "public: __thiscall comp1::comp1(void)" (??0comp1@@$$FQAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
  </code></pre>
  
  <p>If I create inline functions this problem doesn't occur.</p>
  
  <p>On forums you find answers about mistakes with including files, but I'm pretty sure I coded everything correct.</p>
  
  <p>Thank you.</p>