17

From one of my customers I got an application. When I try to run it I got following error

error while loading shared libraries: ./libvtkWidgets.so.5.4: file too short

In my project structure I see following:

-rwxrwxrwx  1 tomasz tomasz       20 2011-02-01 10:44 libvtkWidgets.so
-rwxrwxrwx  1 tomasz tomasz       22 2011-02-01 10:44 libvtkWidgets.so.5.4
-rwxrwxrwx  1 tomasz tomasz  2147103 2011-02-01 10:44 libvtkWidgets.so.5.4.2

Is my shared library libvtkWidgets corrupted ? How to solve that error ?

tommyk
  • 4,406
  • 7
  • 37
  • 41
  • Running `sudo ldconfig` gives you the exact problem ("File *** is empty, not checked." or "*** is not a symbolic link") – Yan Foto Dec 15 '15 at 11:17
  • 1
    This happened to me when extracting the archive with 7-Zip. Using `tar` fixed the issue, see [here](https://unix.stackexchange.com/questions/600282/preserve-file-permissions-and-symlinks-in-archive-with-7-zip/600283). – Matthias Braun Jul 25 '20 at 11:30

1 Answers1

24

There was probably an error copying/extracting the libraries. libvtkWidgets.so and libvtkWidgets.so.5.4 should not be files but symbolic links. Try the following:

rm libvtkWidgets.so.5.4 libvtkWidgets.so
ln -s libvtkWidgets.so.5.4.2 libvtkWidgets.so.5.4
ln -s libvtkWidgets.so.5.4 libvtkWidgets.so

Anyway you should check if the software that you are installing is available from the software center. If it is not available and if the above fix does not work you will need to contact the application provider.

João Pinto
  • 17,029
  • 5
  • 55
  • 68
  • 3
    Thanks a lot, indeed I did a mistake extracting files on Windows and copying extracted files to my Ubuntu virtual machine. That's why all symbolic links were gone. – tommyk Feb 01 '11 at 13:17
  • I'm creating my own C++ extension, and even after making it a symbolic link the problem persisted. Is there a cache I'm not aware of? – noɥʇʎԀʎzɐɹƆ Aug 09 '16 at 00:59
  • Same thing here @tommyk. Used 7zip to extract on Windows and then tried to use the Hadoop files in my WSL instance. – forgetso Mar 09 '21 at 11:26