Reputation: 2079
I am trying to make oracle pro*c demo program work on fedora 64-bit OS with express edition of oracle 11.2. When make file of the demo program is run, oracle precompiler gives the following error and aborts:
PCC-F-NOERRFILE, unable to open error message file, facility PR2
Here is the complete output of the pre-compiler:
$ make -f demo_proc_ic.mk
rm -rf SunWS_cachea
rm -rf ../../libclntsh.so
rm -rf procdemo procdemo.o procdemo.c procdemo.lis
make -f demo_proc_ic.mk build OBJS=procdemo.o EXE=procdemo
make[1]: Entering directory `/home/mvsagar/oracle/instantclient_11_2/sdk/demo'
rm -rf SunWS_cachea
rm -rf ../../libclntsh.so
make -f demo_proc_ic.mk PROCFLAGS="" PCCSRC=procdemo I_SYM=include= pc1
make[2]: Entering directory `/home/mvsagar/oracle/instantclient_11_2/sdk/demo'
../proc iname=procdemo include=. sys_include=\(../include,/usr/include,/usr/lib/gcc- lib/x86_64-redhat-linux/3.2.3/include,/usr/lib/gcc/x86_64-redhat-linux/4.1.1/include,/usr/lib64/gcc/x86_64-suse-linux/4.1.2/include,/usr/lib64/gcc/x86_64-suse-linux/4.3/include,/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include,/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include\)
PCC-F-NOERRFILE, unable to open error message file, facility PR2
make[2]: *** [pc1] Error 1
make[2]: Leaving directory `/home/mvsagar/oracle/instantclient_11_2/sdk/demo'
make[1]: *** [procdemo.o] Error 2
make[1]: Leaving directory `/home/mvsagar/oracle/instantclient_11_2/sdk/demo'
make: *** [procdemo] Error 2
As such XE works. I could create a table using sqlplus. I have downloaded and installed instant client basic and precompiler zips for 64 bit linux.
Any idea if I have to install anything else? Or any other settings I have to make?
Upvotes: 2
Views: 9330
Reputation: 2079
Finally I resolved the problem by changing value of ORACLE_HOME and LD_LIBRARY_PATH environment variable. Though there were instances of resolving the same problem that I found when googled, it was not clear why they had to change the env var.
I installed Oracle-xe in the path
"/u01/app/oracle/product/11.2.0/xe"
as a root user. Hence ORACLE_HOME was set to this path. I downloaded pro*c/c++ client installation files into a separate directory
"/home/mvsagar/oracle/instantclient_11_2"
to avoid disturbing XE installtion. I installed it after loging into my account with my user name as it did not require root privileges. While compiling under my user name I retained ORACLE_HOME to the XE installation path. But pro*C/C seems to require it to be reset to the path where its files were installed. Hence changed ORACLE_HOME and LD_LIBRARY_PATH to "/home/mvsagar/oracle/instantclient_11_2" as follows:
ORACLE_HOME=/home/mvsagar/oracle/instantclient_11_2
export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
After this, the error disappeared! It is not sufficicent only to set ORACLE_HOME. You need to set LD_LIBRARY_PATH as well.
Of course I have some other compiler issues which I need to resolve.
I got this hint from blog http://oradim.blogspot.in/2009/09/getting-started-with-oracle-proc-on.html
Upvotes: 4