Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OCIEnvInit fails

petehugMay 12 2015 — edited May 21 2015

I'm working on a 32 bit c++ app which I build using VS 2010 Express. I downloaded the 32 bit instant client 12.0.1.2. The basic client ended up here::

I:\oraclexe\XEClient\12.0.1.2\Win32

and the sdk here:

I:\oraclexe\XEClient\12.0.1.2\Win32\sdk

The search order for libs VS 2010 is set as follows:

I:\oraclexe\XEClient\12.0.1.2\Win32\sdk\lib\msvc\vc10

I:\oraclexe\XEClient\12.0.1.2\Win32\sdk\lib\msvc

I copied these files to the same folder as the executable I built:

I:\oraclexe\XEClient\12.0.1.2\Win32\oci.dll

I:\oraclexe\XEClient\12.0.1.2\Win32\ociw32.dll

I:\oraclexe\XEClient\12.0.1.2\Win32\VC10\oraocci12.dll


The reason I did all this is because I have 64bit Oracle11GR2 installed on the same machine, so env var ORACLE_HOME points to I:\oraclexe\app\oracle\product\11.2.0\server and I:\oraclexe\app\oracle\product\11.2.0\server\bin is in the PATH env var.  Obviously my 32bit app must link with 32bit libs and use 32bit DLLs hence the 32 bit client.

I verified OracleXE and the Listener are running and listening on port 1521.

Now whenever my app hits OCIEnvInit, it returns -1. I don't get any more info than that and can't explain why this happens nor where I should look for an answer:

OCIEnv* pEnv;

int status;

status = OCIEnvInit(&pEnv, OCI_DEFAULT, 0, 0);

Any help is greatly appreciated .

This post has been answered by petehug on May 21 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2015
Added on May 12 2015
1 comment
702 views