...: error while loading shared libraries: /usr/lib/libtcl.so: invalid ELF header


I am using Linux thanks to the Mandrake 9.0 distribution (Kernel 2.4.19, Mesa 3D 4.03, GNU gcc 3.2, TCL 8.3.3, Java 2) and I have got an i586 Station (Pentium II 266 MHz, 8.4 Go of ROM, 194 Mo of RAM).

I installed OpenCASCADE (using "install.csh" option 1) under "/home/nico/cascade/CAS4.0". I tried to run the Test Harness (using "demo" in /home/nico/cascade/CAS4.0/src/DrawResources/), but I could read this:

"/home/nico/cascade/CAS4.0/Linux/bin/TTOPOLOGY: error while loading shared libraries: /usr/lib/libtcl.so: invalid ELF header"

I checked that the path configuration was okay and it seems to be correct. Here it is :

LD_LIBRARY_PATH : /home/nico/cascade/CAS4.0/Linux/lib:/home/nico/cascade/CAS4.0/Linux/lib:/home/nico/cascade/CAS4.0/Linux/lib:/usr/X11R6/lib
CASROOT : /home/nico/cascade/CAS4.0
DRAWHOME : /home/nico/cascade/CAS4.0/src/DrawResources

Now, I don't know how to solve this problem, and I didn't find any solution in the OpenCASCADE Users FORUM. Thus, it would be very nice if you could help me to solve this problem.

Thank you in advance.


m-aronsson's picture

Hi !

The error message would indicate that there is som eproblem with the shared library, check that the .so file is a shared library so you didn't get another file in there some way by mistake, also, if it is a symbolic link, check what it is linked to.

It should be pretty east to check the header, take a look at the first few bytes in any other .so file and compare it should be similair.

The only time I got this message I had created an .so file and messed up so that file was 0 bytes in length.


Nico's picture

Indeed, it was the libtcl.so and libtk.so files that were simple texte files instead of symbolic links as i expected (because of their use in the Mandrake 8.1 distribution.
Replacing them by real symbolic links pointing on the libtcl8.3.so and libtk8.3.so respectively resolved the problem.
So thank you very much for your answer M. Aronsson.