LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-19-2011, 03:34 AM   #1
wilsonsamm
Member
 
Registered: Aug 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 105

Rep: Reputation: 15
wrong ELF class: ELFCLASS32


I've been writing a program and a couple of libraries on a 32-bit computer, but when I moved to my other computer (64-bit) I started getting this message when trying to load a shared object.
Code:
Couldn't open /usr/lib/asmp/z80emu.so:
	/usr/lib/asmp/z80emu.so: wrong ELF class: ELFCLASS32
z80emu.so is the shared object in question.

I suppose ELFCLASS32 means a ELF file on a 32-bit architecture, which suggests that my compiler, gcc, is still producing 32 bit code. What can I do? do I need to specify -march= and so on?
 
Old 01-19-2011, 04:59 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
More likely that you've compiled your program on the new system and it's now 64bit but you haven't recompiled the .so, try running 'file' on each one
 
Old 01-19-2011, 06:11 AM   #3
wilsonsamm
Member
 
Registered: Aug 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 105

Original Poster
Rep: Reputation: 15
Oh yeah, I got:

Code:
# file /usr/lib/asmp/z80emu.so 
/usr/lib/asmp/z80emu.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
I'll recompile now
 
Old 01-19-2011, 11:34 AM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Note that parts of some emulators are written in 32-bit assembly ... and will only run on 32-bit, if they haven't been ported.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong elf class message from bbc iplayer referring to gtk 2-0 brynnzoid Linux - Newbie 1 08-13-2009 01:23 PM
error while loading shared libraries: libstdc++.so.5: wrong ELF class: ELFCLASS64 permalac Linux - Software 5 05-06-2009 04:58 AM
Bash Scripting POSIX Class [[:alnum:]] giving wrong output livetoday Linux - Newbie 3 01-21-2008 11:56 PM
Gmail notifier gives error: "wrong ELF class: ELFCLASS32" aero_b Linux - Newbie 13 03-01-2007 07:47 PM
X11 library problem wrong ELF size chewysplace Linux - Software 1 04-12-2004 02:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration