title: Calling MATLAB Engine error: libeng.dll is missing from your computer
body: <p>I am struggling to call MATLAB from a simple .cpp program despite the many resources online for this problem. </p>
  
  <p>My Objective:</p>
  
  <p>Use Microsoft Visual Studio 2010 Professional 64-bit to build .cpp program that
  calls MATLAB Engine for built-in functions and graphs (MATLAB R2013b 64-bit)</p>
  
  <p>What I have done:</p>
  
  <p>In the .cpp file property pages, I have:
  1) Changed the platform to Active(x64)
  2) Added the following paths to the VC++ Directories
      Executable Directories: C:\Program Files\MATLAB\R2013b\bin
      Include Directories: C:\Program Files\MATLAB\R2013b\extern\include
      Reference Directories: C:\Program Files\MATLAB\R2013b\bin\win64
      Library Directories: C:\Program Files\MATLAB\R2013b\extern\lib\win64\microsoft</p>
  
  <p><a href="http://i.stack.imgur.com/lGIB1.jpg" rel="nofollow">Path Edits</a></p>
  
  <p>3) Wrote the following program:</p>
  
  <pre><code>// mEng.cpp : Defines the entry point for the console application.
  // libeng.dll is in C:\Program Files\MATLAB\R2013b\bin\win64
  
  #include "stdafx.h"
  #include &lt;Engine.h&gt;
  #include &lt;matrix.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cmath&gt;
  
  #pragma comment (lib, "libmat.lib")
  #pragma comment (lib, "libmx.lib")
  #pragma comment (lib, "libmex.lib")
  #pragma comment (lib, "libeng.lib")
  #pragma comment (lib, "libut.lib")
  
  using namespace std;
  
  
  int main()
  {
      Engine *m_pEngine;
      if (!(m_pEngine = engOpen(""))) 
            {
              fprintf(stderr, "\nCan't start MATLAB engine\n");
              return EXIT_FAILURE;
            }
  
      //Now call the MATLAB script through MATLAB Engine
  
            engEvalString(m_pEngine, "script");
            cout &lt;&lt; "Hit return to continue\n\n";
            fgetc(stdin);
  
      //Close the MATLAB Engine
  
            engClose(m_pEngine);
            return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>Errors received:</p>
  
  <p>“The program can’t start because libeng.dll is missing from your computer. Try reinstalling the program to fix this problem.”</p>