title: OCCI app crashes when running in debug mode in Visual Studio 2005
body: <p>I'm attempting to get a development environment up and running for developing applications with Oracle C++ Call Interface (OCCI) in Visual Studio 2005.</p>
  
  <p>My system specs are:
  OS: Windows 7, 64-bit
  Oracle: 11g release 11.2.0.2, 32-bit
  Instant Client: BasicLite and SDK version 11.2.0.4 32-bit
  Visual Studio 2005 Professional Edition version 8.0 with 32-bit tools enabled</p>
  
  <p>I've followed <a href="http://oradim.blogspot.dk/2009/07/getting-started-with-occi-windows.html" rel="nofollow">this guide by Mark Williams</a> and I got the example running but <strong><em>only</em></strong> in release mode. When I switch to debug mode the app will build, but when I run it I get the following error:</p>
  
  <pre><code>Problem signature:
  Problem Event Name: APPCRASH
  Application Name:   OCCITest.exe
  Application Version:    0.0.0.0
  Application Timestamp:  53f5dfdd
  Fault Module Name:  KERNELBASE.dll
  Fault Module Version:   6.1.7601.18229
  </code></pre>
  
  <p>The small example program that triggers this error is:</p>
  
  <pre><code>#include "employees.h"
  
  using namespace std; 
  using namespace oracle::occi;
  
  int main (void) 
  { 
    Employees *pEmployees = new Employees();
    delete pEmployees;
    return 0; 
  }
  
  Employees::Employees() 
  {      
    user = "hr"; 
    passwd = "hr"; 
    db = "localhost:1521/service_name";
    env = Environment::createEnvironment(Environment::DEFAULT);
  
    try 
    { 
      con = env-&gt;createConnection(user, passwd, db); 
    } 
    catch (SQLException&amp; ex) 
    { 
      cout &lt;&lt; ex.getMessage();
      exit(EXIT_FAILURE); 
    } 
  }
  
  Employees::~Employees() 
  { 
    env-&gt;terminateConnection (con);
    Environment::terminateEnvironment (env); 
  }
  </code></pre>
  
  <p>If I remove all calls to OCCI functionality the application doesn’t crash. That is, this program runs error-free:</p>
  
  <pre><code>#include "employees.h"
  
  using namespace std; 
  using namespace oracle::occi;
  
  int main (void) 
  { 
    Employees *pEmployees = new Employees();
    delete pEmployees;
    return 0; 
  }
  
  Employees::Employees() 
  { 
    user = "hr"; 
    passwd = "hr"; 
    db = "localhost:1521/service_name";
    cout&lt;&lt;"Look at me, I'm running"&lt;&lt;endl;
  }
  
  Employees::~Employees() 
  {}
  </code></pre>
  
  <p>In the guide Mark mentions that when running in debug mode, the linker should use the library file oraocci11d.lib. However, this file is not included in the Instant Client SDK version 11.2.0.4, so I’m using the input file oraocci11.lib for both the release and debug version. </p>
  
  <p>I'm running out of ideas about how to proceed in solving this problem, and I would greatly appreciate any and all help.</p>