Discussion:
wrong ELF machine type: EM_SPARC
(too old to reply)
Lara Adianto
2005-09-15 09:33:46 UTC
Permalink
Hi all,

I downloaded novell-cldap-devel-2005.07.18-1solaris.tar.gz , and tried to compile the sample code on my solaris, but failed with the following errors:

-bash-3.00# make
gcc -g -I../include -DUNIX -c -o CheckBind.o CheckBind.c
gcc -o CheckBind CheckBind.o -L../lib -lldapsdk -lpthread -lrt -lresolv -lsocket
ld: fatal: file ../lib/libldapsdk.so: wrong ELF machine type: EM_SPARC
ld: fatal: File processing errors. No output written to CheckBind
collect2: ld returned 1 exit status
make: *** [CheckBind] Error 1

What does 'wrong ELF machine type: EM_SPARC' mean ?
I'm compiling it on solaris x86, 5.10
Does the library from downloaded from http://developer.novell.com/ndk/cldap.htm work only on SPARC machine ?
If yes, is there any available library for solaris x86, 5.10 ?

Thanks,
Lara


---------------------------------
Yahoo! for Good
Click here to donate to the Hurricane Katrina relief effort.
David Mair
2005-09-15 14:19:28 UTC
Permalink
Post by Lara Adianto
Hi all,
I downloaded novell-cldap-devel-2005.07.18-1solaris.tar.gz , and tried
to compile the sample code on my solaris, but failed with the following
-bash-3.00# make
gcc -g -I../include -DUNIX -c -o CheckBind.o CheckBind.c
gcc -o CheckBind CheckBind.o -L../lib -lldapsdk -lpthread -lrt -lresolv -lsocket
ld: fatal: file ../lib/libldapsdk.so: wrong ELF machine type: EM_SPARC
ld: fatal: File processing errors. No output written to CheckBind
collect2: ld returned 1 exit status
make: *** [CheckBind] Error 1
What does 'wrong ELF machine type: EM_SPARC' mean ?
The message indicates that the libldapsdk.so you are trying to link your
executable with is built for a different platform than the one you are
building for. You can find a lot of discussion about "wrong ELF machine
type" using Google. Interestingly, I see a significant number of reports
of this on Solaris. I believe that the EM_SPARC part refers to the
actual platform the libldapsdk.so library was built for and not the
platform you are building on (see below).
Post by Lara Adianto
I'm compiling it on solaris x86, 5.10
Clearly a SPARC processor is not a x86 and the library you are using is
the one for SPARC processors (the whole platform is probably
solaris-sparc). If you found it in a location described or named to
indicate it is for Solaris then you should check if that
description/naming indicated the whole platform or just that it was for
Solaris. In the case of the former you used the wrong library, in the
case of the latter the library was incompletely named/described.
Post by Lara Adianto
Does the library from downloaded from
http://developer.novell.com/ndk/cldap.htm work only on SPARC machine ?
If yes, is there any available library for solaris x86, 5.10 ?
Don't know about that part but I suspect someone will respond later today.
Loading...