Re: Viusal Studio.NET & OCCI
From: luke <anduguid_at_shaw.ca>
Date: Fri, 10 Jan 2003 04:46:24 GMT
Message-ID: <AesT9.10611$H7.428821_at_news2.calgary.shaw.ca>
>
>
> I have filed a Metalink TAR on this very issue. Oracle's response was that
> the use of Visual Studio.NET (aka VC++ version 7.00) is unsupported in
> all versions of Oracle, including 9iR2 client/programmer.
>
> However, I have had excellent success and progress integrating Pro*C in
> C++ mode with VS.NET. And the lessons learned there may help elsewhere.
>
> In your DatabaseInterface project, add an additional library directory
> of 'C:\oracle\ora92\precomp\lib\msvc' (suitably adjusted for your
> $ORACLE_HOME value), and add an additional dependency of 'orasql9.lib'.
>
> <Tool Name="VCLibrarianTool"
> AdditionalDependencies="orasql9.lib"
> OutputFile="$(OutDir)/DatabaseInterface.lib"
> AdditionalLibraryDirectories="C:\oracle\ora92\precomp\lib\msvc"/>
>
> Next, in your .PCC file (my name for Pro*C C++ files), set up a custom
> build-step:
>
> <File
> RelativePath="OraRepositoryDatabase.pcc">
> <FileConfiguration
> Name="Debug|Win32">
> <Tool
> Name="VCCustomBuildTool"
> CommandLine="C:\oracle\ora92\bin\proc parse=partial code=cpp include="$(VCInstallDir)/include" cpp_suffix=cpp oname="$(InputDir)/_$(InputName).cpp""
> Outputs="$(InputDir)/_$(InputName).cpp"/>
> </FileConfiguration>
> </File>
>
> Key components of that CommandLine are:
>
> path to PROC text mode compiler,
> 'parse=partial code=cpp', required for C++ code
> 'include="$(VCInstallDir)/include"', to let Pro*C know where your system
> include files are located (double-quotes are in case your Install
> directory contains spaces, like "Program Files"
> 'cpp_suffic=cpp' optional, but feels good
> 'oname="$(InputDir)/_$(InputName).cpp"', to create the output file anme
> with a leading Underscore
>
> Why the leading underscore? Well, because if you use Visual Source
> Safe, and don't remember to checkout (mark as read-write) the destination
> file, Pro*C errors out with an internal assert, related to the fact
> that it couldn't write to the output file.
>
> Then, add a new file named "Blah.cpp", which consists of the 1 line:
> #include "_Blah.cpp"
>
> where "Blah" is the name of your .PCC pro*c precompiled file.
>
> Link. Debug. Repeat.
>
>
>
>
> That was my experience as well.
>
> OCCI is a special case: It can ONLY be bound with the MSVCRT
> libraries, which precludes the use of the debug or other libraries
> in LIBC*, including the MT (multi-thread) or single-threaded
> runtimes. I suppose it might be possible to make VC.NET work
> with MSVCRT, but:
>
> Alas, my application requires being able to DEBUG, so I gave up on
> OCCI.
>
> I attempted to use third party libraries like OCI Wrap, in order
> to gain access to the LOB (BLOB, CLOB, and NCLOB) support, but this
> did not work as well as I had wished. :( And required me to know
> more about their object design than I was willing to spend time
> learning.
>
>
>
>
> You're welcome. I hope this helps. Email questions welcomed, to
> my work address, andy at play dot net.
>
> Andy
>
Received on Fri Jan 10 2003 - 05:46:24 CET
Date: Fri, 10 Jan 2003 04:46:24 GMT
Message-ID: <AesT9.10611$H7.428821_at_news2.calgary.shaw.ca>
thanks for the info andy :)
currently i am working with OCI and wrapping it up with some 'roll your own' functions/class etc. but time is short & i hate reinventing the wheel...
on researching the OCCI issue, i came across OTL http://otl.sourceforge.net/home.htm
i am going to check it out 2morrow.
once again thanks for your time.
luke.
Andy Finkenstadt wrote:
> In <YIqT9.9896$Yo4.464867_at_news1.calgary.shaw.ca> luke <anduguid_at_shaw.ca> writes:
>
>>i know its been discussed before, but the problem of try to build OCCI >>applications with Visual Studio.NET leading to a successful compile & >>link but the application generating 'illegal memory address' errors when >>executed... has it been solved or a workaround perhaps?
>
>
> I have filed a Metalink TAR on this very issue. Oracle's response was that
> the use of Visual Studio.NET (aka VC++ version 7.00) is unsupported in
> all versions of Oracle, including 9iR2 client/programmer.
>
> However, I have had excellent success and progress integrating Pro*C in
> C++ mode with VS.NET. And the lessons learned there may help elsewhere.
>
> In your DatabaseInterface project, add an additional library directory
> of 'C:\oracle\ora92\precomp\lib\msvc' (suitably adjusted for your
> $ORACLE_HOME value), and add an additional dependency of 'orasql9.lib'.
>
> <Tool Name="VCLibrarianTool"
> AdditionalDependencies="orasql9.lib"
> OutputFile="$(OutDir)/DatabaseInterface.lib"
> AdditionalLibraryDirectories="C:\oracle\ora92\precomp\lib\msvc"/>
>
> Next, in your .PCC file (my name for Pro*C C++ files), set up a custom
> build-step:
>
> <File
> RelativePath="OraRepositoryDatabase.pcc">
> <FileConfiguration
> Name="Debug|Win32">
> <Tool
> Name="VCCustomBuildTool"
> CommandLine="C:\oracle\ora92\bin\proc parse=partial code=cpp include="$(VCInstallDir)/include" cpp_suffix=cpp oname="$(InputDir)/_$(InputName).cpp""
> Outputs="$(InputDir)/_$(InputName).cpp"/>
> </FileConfiguration>
> </File>
>
> Key components of that CommandLine are:
>
> path to PROC text mode compiler,
> 'parse=partial code=cpp', required for C++ code
> 'include="$(VCInstallDir)/include"', to let Pro*C know where your system
> include files are located (double-quotes are in case your Install
> directory contains spaces, like "Program Files"
> 'cpp_suffic=cpp' optional, but feels good
> 'oname="$(InputDir)/_$(InputName).cpp"', to create the output file anme
> with a leading Underscore
>
> Why the leading underscore? Well, because if you use Visual Source
> Safe, and don't remember to checkout (mark as read-write) the destination
> file, Pro*C errors out with an internal assert, related to the fact
> that it couldn't write to the output file.
>
> Then, add a new file named "Blah.cpp", which consists of the 1 line:
> #include "_Blah.cpp"
>
> where "Blah" is the name of your .PCC pro*c precompiled file.
>
> Link. Debug. Repeat.
>
>
>>all previous posts on the subject describe the problem but none describe >>a solution.
>
>
> That was my experience as well.
>
> OCCI is a special case: It can ONLY be bound with the MSVCRT
> libraries, which precludes the use of the debug or other libraries
> in LIBC*, including the MT (multi-thread) or single-threaded
> runtimes. I suppose it might be possible to make VC.NET work
> with MSVCRT, but:
>
> Alas, my application requires being able to DEBUG, so I gave up on
> OCCI.
>
> I attempted to use third party libraries like OCI Wrap, in order
> to gain access to the LOB (BLOB, CLOB, and NCLOB) support, but this
> did not work as well as I had wished. :( And required me to know
> more about their object design than I was willing to spend time
> learning.
>
>
>>thanks in advance, >>luke
>
>
> You're welcome. I hope this helps. Email questions welcomed, to
> my work address, andy at play dot net.
>
> Andy
>
Received on Fri Jan 10 2003 - 05:46:24 CET