title: Cannot create valid dll by using Visual C++ 2012
body: <p>I tried to create a dll with Visual C++ 2012 by following <a href="http://msdn.microsoft.com/en-us/library/vstudio/ms235636.aspx" rel="nofollow noreferrer">this walkthrough</a>, but I failed. When I tried to import built dll in a different project as a reference, I got this error: <code>A reference to '***.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.</code>    </p>
  
  <p>I don't understand what my mistake is in code and why I get this error. Here is my header and cpp file:</p>
  
  <h2>DLLEXPORT.H</h2>
  
  <pre><code>__declspec(dllexport) bool setMute();
  __declspec(dllexport) bool setActive();
  </code></pre>
  
  <h2>DLLEXPORT.CPP</h2>
  
  <pre><code>#include "DLLEXPORT.H"
  bool setMute(){
      //some stuff
  }
  bool setActive(){
      //some stuff
  }
  </code></pre>
  
  <p>Moreover, I also tried to solve the problem by this <a href="https://stackoverflow.com/questions/3456758/a-reference-to-the-dll-could-not-be-added">solution</a>, but I got this error: <code>TlbImp : error TI1002 : The input file '****.dll' is not a valid type library.</code></p>