Score:0

libz.so.1: wrong ELF class: ELFCLASS32 - Need to install the 64 bit package for zlib

mm flag

I am getting this error when compiling:

libz.so.1: wrong ELF class: ELFCLASS32

From what I read online this happens when a directory which the script is calling is 32 bit and the script is looking for 64 bit library file.

So, I need to install a 64 bit package zlib.

The Ubuntu version is below:

DISTRIB_ID=Ubuntu

DISTRIB_RELEASE=18.04

DISTRIB_CODENAME=bionic

DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"

Linux 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux


How to install the 64 bit package for zlib ?

Artur Meinild avatar
vn flag
Also `uname -a` - is your release 32 or 64 bit? And in addition, any details about your compilation (command used etc).
Victor avatar
mm flag
@ArturMeinild updated thank you.
Score:0
mm flag

I was able to resolve this issue below on Ubuntu bionic (18.04LTS)

libz.so.1: wrong ELF class: ELFCLASS32

What I did:

To install the 64 bit of lib64z1 package:

  1. apt-get update
  2. apt-get -y install lib64z1
  3. ll /usr/lib64/libz.so.1 <- the file will automatically be put here on install.

You should see:

lrwxrwxrwx 1 root root 14 Aug 16 22:08 /usr/lib64/libz.so.1 -> libz.so.1.2.11

  1. Add path to environment variable -> LD_LIBRARY_PATH so that the script knows where to find 64 bit version of this file -> libz.so.1

export LD_LIBRARY_PATH=/usr/lib64/

This link was helpful: https://packages.ubuntu.com/bionic/i386/lib64z1/filelist

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.