在Visual Studio 2005中以调试模式运行时,OCCI应用程序崩溃 [英] OCCI app crashes when running in debug mode in Visual Studio 2005

查看:130
本文介绍了在Visual Studio 2005中以调试模式运行时,OCCI应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立并运行一个开发环境,以便在Visual Studio 2005中使用Oracle C ++调用接口(OCCI)开发应用程序.

I'm attempting to get a development environment up and running for developing applications with Oracle C++ Call Interface (OCCI) in Visual Studio 2005.

我的系统规格是: 操作系统:Windows 7,64-bit Oracle:11g版本11.2.0.2(32位) 即时客户端:BasicLite和SDK版本11.2.0.4 32位 启用了32位工具的Visual Studio 2005专业版8.0版

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

我已遵循Mark Williams的本指南,我运行了示例,但 处于发布模式.当我切换到调试模式时,该应用程序将生成,但是运行该应用程序时,出现以下错误:

I've followed this guide by Mark Williams and I got the example running but only in release mode. When I switch to debug mode the app will build, but when I run it I get the following error:

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

触发此错误的小示例程序是:

The small example program that triggers this error is:

#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->createConnection(user, passwd, db); 
  } 
  catch (SQLException& ex) 
  { 
    cout << ex.getMessage();
    exit(EXIT_FAILURE); 
  } 
}

Employees::~Employees() 
{ 
  env->terminateConnection (con);
  Environment::terminateEnvironment (env); 
}

如果我删除了所有对OCCI功能的调用,则该应用程序不会崩溃.也就是说,该程序运行无错误:

If I remove all calls to OCCI functionality the application doesn’t crash. That is, this program runs error-free:

#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<<"Look at me, I'm running"<<endl;
}

Employees::~Employees() 
{}

Mark在指南中提到,在调试模式下运行时,链接器应使用库文件oraocci11d.lib.但是,此文件未包含在Instant Client SDK版本11.2.0.4中,因此我将输入文件oraocci11.lib用于发行版和调试版.

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.

我对如何解决此问题的想法不多了,我将不胜感激任何帮助.

I'm running out of ideas about how to proceed in solving this problem, and I would greatly appreciate any and all help.

推荐答案

我有一个相关的问题,就是我已成功使用oraocci12d.dll/msvcr100d.dll,但这反过来又使用了oci.dll/ msvcr100 .dll .即oci.dll没有使用msvcr100的调试版本.

I have a related problem in that I am successfully using oraocci12d.dll/msvcr100d.dll, but this in turn is using oci.dll/msvcr100.dll. ie, oci.dll is not using the debug version of msvcr100.

我的程序似乎运行正常,但是任何内存泄漏报告在退出时都会消失.

My program seems to run okay, but any memory leak reporting disappears on exit.

这篇关于在Visual Studio 2005中以调试模式运行时,OCCI应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆