Operating System - Linux
1748255 Members
4015 Online
108760 Solutions
New Discussion юеВ

Re: ld: Mismatched ABI (not an ELF file) for -lc

 
SOLVED
Go to solution
rajanandhini
Advisor

ld: Mismatched ABI (not an ELF file) for -lc

Hi,
We are upgrading our system from HP-UX 11o to HP-UX 11i. While compiling the C codes, we get the following error.
ld: Mismatched ABI (not an ELF file) for -lc
Fatal error.
The following is the entry that we have in the make file and while compiling this part, we get the above said error.
../bin/odlcomp: odlcomp.c $(HDRS)
$(LPATH) cc $(CFLAGS) odlcomp.c $(CCLIBS) -ldld -Wl,+s -o $@
Any help in this regard will be appreciated.
Please let me know if any more details are needed.

Thanks



6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: ld: Mismatched ABI (not an ELF file) for -lc

Shalom,

I know nothing about the error, but please readon.

Important:not an ELF file

This is a PA-RISC system.

So:
1) You may not want to compile an ELF program on this system.
2) If you did it on the previous system you probably had special software installed to do the job. I'm guessing its not installed on the 11i v1 system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: ld: Mismatched ABI (not an ELF file) for -lc

This means you are using +DD64 when compiling but forgot to use +DD64 when linking.

What does LPATH have in it? It better have /usr/lib/pa20_64 in it and not /usr/lib.

Note: You should NOT be using LPATH. This should be reserved for the driver. Use -L instead.

>SEP: 1) You may not want to compile an ELF program on this system.

64 bit mode files are ELF on PA.
rajanandhini
Advisor

Re: ld: Mismatched ABI (not an ELF file) for -lc

Hi,

Thanks for the information. Again i tried compiling the scripts by including the /usr/lib/pa20_64 path in the LPATH. I get the same error as before. LPATH now contains LPATH=../bin:/lib:/usr/lib/pa20_64:/usr/lib:/pkg1/sybase_base/lib
We tried executing the same program in this machine. But while compiling it, we got the above said error.
Please advice.
Dennis Handly
Acclaimed Contributor

Re: ld: Mismatched ABI (not an ELF file) for -lc

>LPATH now contains LPATH=../bin:/lib:/usr/lib/pa20_64:/usr/lib:/pkg1/sybase_base/lib

Do NOT use LPATH. Use the appropriate -L paths.

In your case, illegally using /lib and /usr/lib will give you this error. (Note /lib and /usr/lib are the same, don't use both.)

Using ../bin doesn't make sense since libs should be in lib and not bin. Remove /usr/lib/pa20_64 since the default.

So remove the LPATH macro and create:
LIBS=-L../bin -L/pkg1/sybase_base/lib
(Assuming you really want bin?)

Then add $(LIBS) to the end of your link line.
rajanandhini
Advisor

Re: ld: Mismatched ABI (not an ELF file) for -lc

Thanks a lot for your assistance.

When i tried to make the file with the instructions said by you, we got the following error.

sh: ../bin: Execute permission denied.
*** Error exit code 126

The bin directory actually has full execution permission. i.e it has 777 permission.

Could you please help us in solving this?

Dennis Handly
Acclaimed Contributor
Solution

Re: ld: Mismatched ABI (not an ELF file) for -lc

>When i tried to make the file with the instructions said by you, we got the following error.
>sh: ../bin: Execute permission denied.

It appears you are putting $(LIBS) on the beginning of the line. These are not env vars but driver options. I said:
Then add $(LIBS) to the END of your link line.