Operating System - Linux
1748180 Members
4014 Online
108759 Solutions
New Discussion юеВ

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

 
SOLVED
Go to solution
RGreen
New Member

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

We are migrating to a new version of our C compiler. When I compile the existing application, the error 'Mismatched ABI (not an ELF file) for -lcli' stops the compile. (error display is below). I am new to C and I really don't know what the -lcli is referring to.

Can someone help? I've also attached the makefile information (see below - Makefile.autocorr.ora8)

--------------------------------------------
error display
--------------------------------------------
Pro*C/C++: Release 10.2.0.3.0 - Production on Tue Jun 5 15:54:04 2007

(taxsun05:rgreen):ca10:> make -f Makefile.autocorr.ora8 autocorr
if [ "" = "shared" ]; then \
/u21/oracle/product/102030_64/bin/echodo cc +DA2.0W +DS2.0 -DSS_64BIT_SERVER -I. -I/u21/oracle/product/102030_64/precomp/public -I\
else \
/u21/oracle/product/102030_64/bin/echodo cc +DA2.0W +DS2.0 -DSS_64BIT_SERVER -I. -I/u21/oracle/product/102030_64/precomp/public -I\
fi
cc +DA2.0W +DS2.0 -DSS_64BIT_SERVER -I. -I/u21/oracle/product/102030_64/precomp/public -I/u21/oracle/product/102030_64/rdbms/public -I/u21/ord
ld: Mismatched ABI (not an ELF file) for -lcli
Fatal error.
*** Error exit code 1

--------------------------------------------
Makefile.autocorr.ora8
--------------------------------------------
.SUFFIXES : .pc .o .c .h

#(DPM) SHELL=/usr/bin/ksh

include $(ORACLE_HOME)/precomp/lib/env_precomp.mk

# Uncomment line below for AIX
# Added "-Ae" for HP 03.01.1999, S. Bottle
#MYCFLAGS = -Ae -O -DCACS_ORA -g -DDEBUG
MYCFLAGS = -Ae -O -DCACS_ORA
# Uncomment line below for SUN
#KSSUN MYCFLAGS = -DCACS_ORA -DCACS_SUN -D__EXTENSIONS__ #-g -DDEBUG

PROC_INCLUDE= INCLUDE=$(PRECOMPHOME)public INCLUDE=$(RDBMSHOME)public INCLUDE=$(RDBMSHOME)demo INCLUDE=$(PLSQLHOME)public INCLUDE=$(NETWORKHOME)public
MYPROCFLAGS= DEFINE=CACS_ORA SQLCHECK=SEMANTICS MODE=ANSI LINES=YES CHAR_MAP=VARCHAR2 DBMS=V8 USERID=${CACS_USER}/${CACS_PASSWD} $(PROC_INCLUDE)

#
#
# Makefile for Auto Correspondence (used in CACSPlus)
#
#


MATHLIBS = -lm
DRMLIB = -L./ -lcli
INCLUDE_DIR=./

DEVTTLIBS=$(TTLIBS)
CLIBS=$(TTLIBS_QA) $(LDBLIBS)
LDSTRING=
PRODUCT_LIBHOME=
NETWORKHOME=$(ORACLE_HOME)/network/
PLSQLHOME=$(ORACLE_HOME)/plsql/
I_SYM=-I
INCLUDE=$(I_SYM). $(I_SYM)$(PRECOMPHOME)public $(I_SYM)$(RDBMSHOME)public $(I_SYM)$(RDBMSHOME)demo $(I_SYM)$(PLSQLHOME)public $(I_SYM)$(NETWORKHOME)public


#
# Application specific definitions
#

OBJECTS = autocorr.o gendoc.o getdoc.o getaddr.o logmsg.o utils_corr.o dbio.o runtime.o docinfo.o drm.o guidrm.o savedoc.o crehist.o pandi.o log_err.o


.pc.o :
$(PROC) $(MYPROCFLAGS) $(PROCFLAGS) iname=$*
$(CC) $(MYCFLAGS) $(CFLAGS) -c $*.c || rm -f $*.c
-rm -f $*.c

.c.o :
$(CC) $(MYCFLAGS) $(CFLAGS) -c $*.c

autocorr: $(OBJECTS)
# Uncomment lines below for AIX
if [ "$(ORA_CLIENT_LIB)" = "shared" ]; then \
$(ECHODO) $(CC) $(CFLAGS) $(MYCFLAGS) -o autocorr $(OBJECTS) $(MATHLIBS) $(DRMLIB) -L$(LIBHOME) $(LIBCLNTSH); \
else \
$(ECHODO) $(CC) $(CFLAGS) $(MYCFLAGS) -o autocorr $(OBJECTS) $(MATHLIBS) $(DRMLIB) -L$(LIBHOME) $(LIBMM) $(NAEDHS) $(NAETAB) $(SYSLIBS) $(PROLDLIBS); \
fi
# Uncomment lines below for KSSUN
# if [ "$(ORA_CLIENT_LIB)" = "shared" ]; then \
# $(ECHODO) $(CC) $(CFLAGS) -o autocorr $(OBJECTS) $(MATHLIBS) $(DRMLIB) -L$(LIBHOME) $(LIBCLNTSH); \
# else \
# $(ECHODO) $(CC) $(CFLAGS) -o autocorr $(OBJECTS) $(MATHLIBS) $(DRMLIB) -L$(LIBHOME) $(LIBMM) $(NAEDHS) $(NAETAB) $(SYSLIBS) $(PROLDLIBS); \
# fi

autocorr.o : $(INCLUDE_DIR)/autocorr.h $(INCLUDE_DIR)/lerrno.h
getdoc.o : $(INCLUDE_DIR)/autocorr.h $(INCLUDE_DIR)/lerrno.h
docinfo.o : $(INCLUDE_DIR)/autocorr.h $(INCLUDE_DIR)/lerrno.h
guidrm.o : $(INCLUDE_DIR)/autocorr.h $(INCLUDE_DIR)/lerrno.h
savedoc.o : $(INCLUDE_DIR)/autocorr.h $(INCLUDE_DIR)/lerrno.h
crehist.o : $(INCLUDE_DIR)/autocorr.h $(INCLUDE_DIR)/lerrno.h
gendoc.o : $(INCLUDE_DIR)/autocorr.h $(INCLUDE_DIR)/lerrno.h
runtime.o : $(INCLUDE_DIR)/autocorr.h
dbio.o : $(INCLUDE_DIR)/autocorr.h $(INCLUDE_DIR)/lerrno.h

clean :
rm -f *.o
rm -f crehist.c dbio.c docinfo.c getdoc.c guidrm.c savedoc.c tst.c log_err.c

cleanall : clean
rm -f autocorr
4 REPLIES 4
Sandman!
Honored Contributor

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

Even though you have "+DA2.0W" mode for 64-bit compilation it might be better to replace it with "+DD64". See if that helps in compiling the application in 64-bit mode.
James R. Ferguson
Acclaimed Contributor
Solution

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

Hi:

The objects and shared libraries must either be all 32-bit or all 64-bit. The linker ('ld') chooses the first object specified on its command line and expects the remaining objects to be the same "bitness". If they are not, the error you see is reported.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

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

>I really don't know what the -lcli is referring to.

This is where -lcli comes from:
DRMLIB = -L./ -lcli

Do you have libcli.* in the current directory?
Is it 64 bit as JRF says? If the 64 bit version is in another directory, you'll need to change the -L path in DRMLIB.

>Sandman: better to replace it with "+DD64".

That's a very good idea but not likely to help. You need it when you port to IPF.
RGreen
New Member

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

Thanks to all of you.

It appears that my problem was with the libcli being compiled as 32 bit. I added the +DA2.0W +DS2.0 -DSS_64BIT_SERVER to the compile options. It took care of the problem. I'm not sure why this is compiled seperately from the main application though.

Thanks again :)

#UTAX need CFLAGS set to compile in ANSI extened mode
CFLAGS=-Ae +DA2.0W +DS2.0 -DSS_64BIT_SERVER

libcli.a : libcli.a(sock.o) libcli.a(utils_lib.o)
@echo libcli.a is now up to date.

clean :
rm -f libcli.a