in reply to Re^2: wrong ELF class
in thread wrong ELF class

But how can that happen?

The oracle knows  [ddg://wrong ELF class: ELFCLASS64] wrong ELF class: ELFCLASS64 -> Wrong ELF Class - requires consistent compiler flags (Surfing With a Linker Alien)