Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a bash script and it gives the following error. Anyone has any idea how to sort this out?

error while loading shared libraries: wrong ELF class: ELFCLASS64

share|improve this question

closed as off-topic by dobey, Luis Alvarado Jul 25 '14 at 21:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – dobey, Luis Alvarado
If this question can be reworded to fit the rules in the help center, please edit the question.… – bain Jul 25 '14 at 21:10
@bain, thanks but I'm not compiling anything. – Mikael S. Jul 25 '14 at 21:13
Try to see echo $LD_PRELOAD, in case it points to the shared library try to unset the variable in the script. (Which script is it?) – Hastur Jul 25 '14 at 21:20
up vote 3 down vote accepted

The linker is complaining that it can't link a 64-bit library to a 32-bit program. If you have a 32-bit system you should install 32-bit programs and libraries. If you have a 64-bit system, you can install either 32-bit or 64-bit programs, but if you install 32-bit you have to ensure that it will get linked against 32-bit libraries. If that is the case, see this answer for how to do so.

share|improve this answer
Thanks. Would you tell me how I can install the 32 bit version of omniORB libs? – Mikael S. Jul 25 '14 at 21:34
apt-get install libomniorb4-1:i386 – bain Jul 25 '14 at 21:37
Damn, thanks man. I've been banging my head for a while. – Mikael S. Jul 25 '14 at 21:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.