title: Link a C++/CLI library in a CLR console project
body: <p>I see on a question that it wasn't possible to link a static C++/CLI library, so I generated a dynamic one and try to link it in a C++ CLR console project with no success
  I get:
  Error   1   error LNK2020: unresolved token (06000001) cBox::.ctor  pTest9.obj<br>
  I put the dll (Project ->reference->add new reference) set the include files in the project
  (include file with no code)</p>
  
  <p>I don't know what to do (I am new with the C++/CLI)</p>
  
  <p>thanks for suggestions/solution</p>
  
  <p>Library Project declared as DLL</p>
  
  <pre><code>#include "stdafx.h"
  
  using namespace System;
  
  ref class cBox
  {
  public:
  cBox() ;
  cBox(double lv,double bv,double hv);
  
  double Volume();
  
  private:
  double Length;
  double Width;
  double Height;
  };
  </code></pre>
  
  <p>CODE OF THE LIBRARY :</p>
  
  <pre><code>#include "stdafx.h"
  #include "cBox.h"
  
  
  cBox::cBox() 
  {
  Console::WriteLine(L"No arg constructor called");
  
  Length  = 1.0 ;
  Width       = 1.0 ;
  Height  = 1.0   ;
  
  }
  
  cBox::cBox(double lv,double bv,double hv)
  {
  Console::WriteLine(L"Constructor called");
  
  Length  =   lv;
  Width       =   bv;
  Height  =   hv;
  
  }
  double cBox::Volume()
  {
      return Length*Width*Height;
  }
  </code></pre>
  
  <p>Then in the Console CLR Project I try to link this library, I get its .h file </p>
  
  <pre><code>#include "stdafx.h"
  #include "cBox.h"
  
  using namespace System;
  
  
  int main(array&lt;System::String ^&gt; ^args)
  {
  
  Console::WriteLine(L"Test Library:\n");
  
  cBox^ oBox; // handle of type box
  
  oBox = gcnew cBox;
  
  Console::WriteLine(L"Default Box Volume {0}",oBox-&gt;Volume());
  
    return 0;
  }
  </code></pre>