Troubleshooting > Resolving the "wrong ELF class" or "bad magic number" Errors

Resolving the "wrong ELF class" or "bad magic number" Errors

Article #: Product: Version:

Summary

The wrong ELF class and bad magic number errors indicate that there is a bit level mismatch between the components of a program. When compiling or running a program, all necessary components must be the same bit level; it is not possible to mix the bit levels of a program and any required libraries. For example, a 32-bit program requires that all needed libraries are also 32-bit, it cannot use a 64-bit library.

To resolve these errors, ensure that the bit level is the same across DMExpress and any interfacing programs, components, and libraries, and that the system's library path contains the correct paths to the correct bit level libraries.

Symptom

When a bit level mismatch exists on a Linux or UNIX system while doing one of the following:

the following error messages can be issued:

Wrong ELF class: ELFCLASS64

Wrong ELF class: ELFCLASS32

Module has an invalid magic number

Resolution

The wrong ELF class and bad magic number errors can usually be resolved by confirming that the bit level of DMExpress is the same as the bit level of other software you are using and that the system's library path contains the correct paths to the correct bit level libraries.

The resolution depends on the situation in which the error occurred.

Additional Information

Confirming the Bit Level of a Program or Library

If your program is already built and compiled you can determine its bit level with the following command:

file <filename>

The result of the command indicates what bit level of the file. Consider the following examples from various systems:

Linux

Solaris

HP-UX Itanium

HP-UX PA-RISC

AIX

Additional Information

See the Extended support options section of Step by step installation on a UNIX system in the DMExpress Help.

Last updated: