Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

saravanakumar90

Programmer
Apr 22, 2015
5
US
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.
 
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.
 
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.

 
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.
 
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
Try it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top