Re: Problems with occi on windows

From: Gene Gorokhovsky <musor102_at_yahoo.com>
Date: 9 Jul 2002 13:48:38 -0700
Message-ID: <6066c898.0207091248.13197f06_at_posting.google.com>


I have not been able to resolve the issue with Visual Studio .NET, but MSVC 6 can be made to work by setting the linking and compilation options similarly to what Oracle has in the oci/samples/make.bat, for instance

cl -GX -DWIN32COMMON -I. -I%ORACLE_HOME%\oci\include -I. -D_DLL -D_MT %1.cpp /link /LIBPATH:%ORACLE_HOME%\oci\lib\msvc oci.lib msvcrt.lib msvcprt.lib oraocci9.lib /nod:libc

In the MSVC UI add
"WIN32COMMON;_MT;_DLL" to C/C++ : Preprocessor: Preprocessor definitions,
"oci.lib msvcrt.lib msvcprt.lib oraocci9.lib" to Link : Object/Library modules
and check Link : Ignore all default libraries

Some of these hoops are result of OCCI being a C++ DLL and returning C++ objects. Because these get allocated by the runtime linked by OCCI, and their destruction is attempted by runtime linked by the application,if the runtimes in question are different (for example debug/release) heap corruption occurs.

Gene

"Jesper Wolf Jespersen" <oz8ace_at_qsl.net.spam> wrote in message news:<3d0d11ed$0$675$edfadb0f_at_dspool01.news.tele.dk>...
> We are trying to get OCCI to work on the windows platform (NT/2000) and have
> encountered a rather strange problem.
>
> When compiling the demo programs with the provided makefile things seem to
> work, but when we enable debugging we get problems as soon as the
> createconnection method is called.
> Using MSVC 6 we get an assertion error indicating that the createconnection
> method has corrupted the heap.
> Uning MSVC 7 we get an application error popup telling us an illegal memory
> adress was being read.
>
> I would like to know if these are known problems and if there is a
> workarround.
>
> The code we have written our selves has the same problem when compiled and
> linked with the debugging libraries, but seem to work when compiled without
> debugging info.
>
> I dont realy trust a library that exibits this kind of behaviour, if it
> trashes the memory arena then that problem will probably show up sometime in
> the application we write. And it is a major inconvenience not being able to
> debug our own code.
>
> I would like to know if any of you are using OCCI on the windows platform
> and what your experiences are.
>
> I would hate to se my project fail because there is an inherent error in the
> OCCI library.
>
> Greetings from denmark
> Jesper Wolf Jespersen
Received on Tue Jul 09 2002 - 22:48:38 CEST

Original text of this message