Error in Pro*c compilation [message #150005] |
Mon, 05 December 2005 23:50 |
jaswin
Messages: 11 Registered: December 2005 Location: India
|
Junior Member |
|
|
Hi !
I have written a Pro*c program with Oracle 7 version (Solaris). It works fine . But when now USING Oracle 10G (Linux)...I am trying to compile it , I could convert the sample.pc into sample.c using the command
$proc sample.pc.......
But using the gcc command when I try to generate the executable code......I get the error........as shown below....
$ gcc -o sample sample.c
/tmp/cc24QDcV.o(.text+0x74): In function `main':
: undefined reference to `sqlca'
/tmp/cc24QDcV.o(.text+0x19f): In function `main':
: undefined reference to `sqlcxt'
/tmp/cc24QDcV.o(.text+0x205): In function `main':
: undefined reference to `sqlca'
/tmp/cc24QDcV.o(.text+0x361): In function `main':
: undefined reference to `sqlcxt'
collect2: ld returned 1 exit status
The header files listed above are in $ORACLE_HOME/precomp/public
directory.
Can anyone point out the cause and remedy for this error....
regds.
J.S.Sachdeva
|
|
|
Re: Error in Pro*c compilation [message #276189 is a reply to message #150005] |
Wed, 24 October 2007 05:46 |
ankurjain
Messages: 11 Registered: July 2007 Location: Vadodara, Gujarat, India
|
Junior Member |
|
|
Hi,
u have to link libclntsh.so which is in $ORACLE_HOME/lib directory and include headers from $ORACLE_HOME/precomp/public
means u do like this :
gcc -o sample -I$ORACLE_HOME/precomp/public -L$ORACLE_HOME/lib -lclntsh sample.c
this will do the compiling and remove the listed errors ....
this works on linux.
[Updated on: Wed, 24 October 2007 06:54] Report message to a moderator
|
|
|