Share

oratcl

Tracker: Bugs

5 error linking against 64-bit libclntsh.so - ID: 1525418
Last Update: Comment added ( tmh )

I compiled Oratcl against a 64-bit Oracle installation
and got the following error when executing a test script:

---BEGIN ERR MESSAGE---
Oratcl_Init(): Failed to load
/db/app/oracle/product/10.0.1.2/lib/libclntsh.so with
error ld.so.1: test_oratcl.tcl: fatal:
/db/app/oracle/product/10.0.1.2/lib/libclntsh.so: wrong
ELF class: ELFCLASS64

while executing
"load
/home/rover/aa469817/programs/lib/Oratcl4.4/libOratcl4.4.so"
("package ifneeded" script)
invoked from within
"package require -exact Oratcl 4.4"
(file "./test_oratcl.tcl" line 5)
---END ERR MESSAGE---

After some googling on "wrong ELF class: ELFCLASS64", I
came across a discussion thread which advised this was
due to trying to invoke a 64-bit library using a 32-bit
executable (which my compiled version of tcl must
be...the discussion thread is here, and it's related to
Perl's Oracle package, but the information was
relevant:
http://www.issociate.de/board/post/211258/Can't_load_Oarcle.so.html)

The fix was to compile Oratcl against
$ORACLE_HOME/lib32 instead of $ORACLE_HOME/lib, which i
accomplished by editing line 385 of oratcl.c to be:

pt2_obj = Tcl_NewStringObj("lib32", -1);

instead of

pt2_obj = Tcl_NewStringObj("lib", -1);


This code edit fixed my specific problem, however it's
clearly hack and not a real fix. Perhaps the program
should check for the existence of
$ORACLE_HOME/lib32/libclntsh.so and link against that,
defaulting to $ORACLE_HOME/lib/libclntsh.so only in its
absence? Just my first guess at a fix...

Anyway, thanks for the product, other than this compile
error it works great, I really appreciate the effort!!

--Kris


jimjamjoh ( jimjamjoh ) - 2006-07-19 16:32

5

Closed

Fixed

Todd Helfter

None

None

Public


Comment ( 1 )

Date: 2006-07-19 17:32
Sender: tmhProject AdminAccepting Donations

Logged In: YES
user_id=92123

Hello Kris,

This is a known issue on solaris and is technically fixed.

If you were to set the ORACLE_LIBRARY environment veariable to
$ORACLE_HOME/lib32/libclntsh.so

Then the 'package require Oratcl' will work properly.

-Todd


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2006-07-19 17:32 tmh
resolution_id None 2006-07-19 17:32 tmh
assigned_to nobody 2006-07-19 17:32 tmh
close_date - 2006-07-19 17:32 tmh