INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

ld: fatal: file /usr/local/lib/libimsl.so: wrong ELF class: ELFCLASS64

ld: fatal: file /usr/local/lib/libimsl.so: wrong ELF class: ELFCLASS64

ld: fatal: file /usr/local/lib/libimsl.so: wrong ELF class: ELFCLASS64

(OP)
I'm getting the following error while compiling a fortran program in Unix (Solaris). I hope its exactly while linking library.

"ld: fatal: file /usr/local/lib/libimsl.so: wrong ELF class: ELFCLASS64"

How to fix this error. I'm clueless about the error.Can anyone please help..
I'm a beginner to FORTRAN

Thanks in advance.

RE: ld: fatal: file /usr/local/lib/libimsl.so: wrong ELF class: ELFCLASS64

Looks like a 32-bit/64-bit problem. It is picking up the 32-bit library but you're running a 64-bit compiler. You need to look for the 64 bit library - probably something like /usr/local/lib64/... The last time I used Solaris was 2002 so I'm more than a bit rusty.

RE: ld: fatal: file /usr/local/lib/libimsl.so: wrong ELF class: ELFCLASS64

Yeah...something about 32 vs 64 bit thing.

I actually understand it opposite to what xwb says...it seems your compilation found a 64-bit ELF and maybe it was expecting a 32-bit one...after all, it is looking in /usw/local/lib and not /usw/local/lib64.

Could it be that somebody installed 64-bit IMSL in the wrong place?

What machine are you running on? is it 64-bit?

Lastly, what are you still doing in Solaris? Just kidding...don't want to start a flame war...it is just that we stopped using Solaris a while ago and started to use Linux, instead.

RE: ld: fatal: file /usr/local/lib/libimsl.so: wrong ELF class: ELFCLASS64

(OP)
Its Unix (solaris) using 64Bit. I hope the fortran compiler is using 32Bit and which is trying to link the 32bit executable with 64 bit imsl library and its throwing the error. Is there a way to compile the executable as 64bit. Any flags to set 64bit while building the executable.. Please help.

RE: ld: fatal: file /usr/local/lib/libimsl.so: wrong ELF class: ELFCLASS64

The compiler has the option for linking with libraries (-l) and for adding library search path (-L).

I would look at the environment variables (don't know what command works for you: env, printenv, set, ...)
Then I would try to remove the libary I don't want from the PATH and add the library I want to the PATH.
The library you want is probably not in the path or in other variable, which the compiler need. Here they write, that you have to set the variables: LD_LIBRARY_PATH and LD_LIBRARY_PATH_64
http://docs.oracle.com/cd/E19205-01/819-5262/aeude...
Try it.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close