Error in linking the ec program ld: 0711-317 ERROR:
Posted in 2003
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
Hi Guys, I am getting this error while compiling the ec code using gcc thru make file.Could any of you help out with this ? The error is as follows make -f popvollabel.mak gcc -o popvollabel popcreat.o popvollabel.o -L/project/kwk/xf/lib -lxfapi -L/project/kwk/ic/lib -lmisc -lcxc -L/project/kwk/xf/lib -lfilag -L/informix7/lib -L/informix7/lib/esql -losshr -lgenshr -lsqlshr ld: 0711-317 ERROR: Undefined symbol: .sqli_connect_open ld: 0711-317 ERROR: Undefined symbol: .sqli_prep ld: 0711-317 ERROR: Undefined symbol: .sqli_curs_locate ld: 0711-317 ERROR: Undefined symbol: .sqli_curs_decl_dynm ld: 0711-317 ERROR: Undefined symbol: .sqli_connect_close ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status make: 1254-004 The error code from the last command is 1. Stop. The make file popvollabel.mak is as follows ####################################################################### #XF = /u/kwk/xf XF = /project/kwk/xf CC = gcc CCC = gcc XFINCL = -I$(XF)/include #COMINCL = -I/u/kwk/ic/include COMINCL = -I/project/kwk/ic/include DEBUG = TRACE = -D_UTTRACE CFLAGS = -c $(DEBUG) $(TRACE) CCFLAGS = -c $(DEBUG) $(TRACE) -DRS6000 ESQL = $(INFORMIXDIR)/bin/esql ESQLINCL = $(INFORMIXDIR)/incl/esql ESQLFLAGS = # Rules .SUFFIXES:.C .cpp .o .ec .c .h .C.o: $(CCC) $(CCFLAGS) $(XFINCL) $(COMINCL) $< .cpp.o: $(CCC) $(CCFLAGS) $(XFINCL) $(COMINCL) $< .c.o: $(CC) $(CFLAGS) $(XFINCL) $(COMINCL) $< .ec.o: $(ESQL) $(ESQLFLAGS) $(CFLAGS) $(ESQLINCL) $(XFINCL) $(COMINCL) $< - rm $*.c ###################################################################### # Libraries ###################################################################### # xf library XF_LIBDIR = $(XF)/lib XF_LIBS = -L$(XF_LIBDIR) -lxfapi # Filing Agent base class set FA_LIBDIR = $(XF)/lib FA_LIBS = -L$(FA_LIBDIR) -lfilag #FA4_LIBS = -L$(FA_LIBDIR) -lfilag4 # Common libraries #COM_LIBDIR = /u/kwk/ic/lib COM_LIBDIR = /project/kwk/ic/lib COM_LIBS = -L$(COM_LIBDIR) -lmisc -lcxc # Informix Database libraries INF_LIBS = -L$(INFORMIXDIR)/lib -L$(INFORMIXDIR)/lib/esql \\ -losshr -lgenshr -lsqlshr LDLIBS = $(XF_LIBS) $(COM_LIBS) $(FA_LIBS) $(INF_LIBS) #LDLIBS4 = $(XF_LIBS) $(COM_LIBS) $(FA4_LIBS) $(INF_LIBS) ###################################################################### # Source files ###################################################################### SRC_EC = popcreat.ec SRC_C = popvollabel.c ###################################################################### # Target: popvollabel ###################################################################### all: popvollabel EC_OBJS = $(SRC_EC:.ec=.o) C_OBJS = $(SRC_C:.c=.o) # for PowerImage 5.0 popvollabel: $(EC_OBJS) $(C_OBJS) $(CCC) -o $@ $(EC_OBJS) $(C_OBJS) $(LDLIBS) My ec program is as follows #include <stdlib.h> #include <stdio.h> #include <string.h> #include "utmisc.h" #include "uttrace.h" #include "popcreat.h" $include sqlca; $include datetime; $include decimal; extern char sAudLogFile[81]; extern char gsVolLabel[31]; extern char gsDBName[31]; extern char gsArchDBName[81]; $string s_szDbRXArch[31]; int sqlNewVolTableCreation(const char *pTableName, const char *pDBName) { $string doc_type[9], doc_token[129], cust_name[31], nric[21], currency_type[3], bnr_ref[31]; $datetime date_created; $string *sstmt; char sTableName[31]; char *sVol, sSingleChar[1], sMsg1[81]; time_t tNow; int ni; strcpy(sTableName, pTableName); printf("Table name : %s", sTableName); tNow = time(0); /* connect to RX database */ /* EXEC SQL connect to :s_szDbRXArch; */ $connect to :s_szDbRXArch; if (sqlca.sqlcode < 0) { doLog("RX database db_rxarch could not be connected","",""); return -1; } /* Prepare SQL statement to query */ sprintf(sstmt, "SELECT bnr_ref, doc_type, cust_name, nric, currency_type,sing_amt, txn_amt, date_created, doc_token FROM %s WHERE doc_token LIKE '%%s%'", sTableName, gsVolLabel); printf(sstmt); EXEC SQL prepare s1ctl from :sstmt; EXEC SQL declare curs1 cursor for s1ctl; /* $INSERT INTO :sTableName( bnr_ref, doc_type, cust_name, nric, currency_type,sing_amt, txn_amt, date_created, doc_tokeni) VALUES ( SELECT * FROM customer WHERE doc_token LIKE :sVolName); */ strcpy(sMsg1, ""); if (sqlca.sqlcode < 0) { sprintf(sMsg1, "%s table insert error error, sqlcode is %d", sTableName, SQLCODE); doLog(sMsg1, "", ""); return -1; } EXEC SQL disconnect current; if (sqlca.sqlcode < 0) { doLog("RX database db_rxarch could not be closed","",""); return -1; } return 0; } /************************************************************************** Sets the name of the database to connect. pDbName (i) Database name. ***************************************************************************/ void sqlSetDb(const char *pDbName) { strcpy(s_szDbRXArch, pDbName); } TIA Amit
Amit Sawhney wrote: > Hi Guys, > > I am getting this error while compiling the ec code using gcc thru > make file.Could any of you help out with this ? > > The error is as follows > make -f popvollabel.mak > gcc -o popvollabel popcreat.o popvollabel.o -L/project/kwk/xf/lib > -lxfapi -L/project/kwk/ic/lib -lmisc -lcxc -L/project/kwk/xf/lib > -lfilag -L/informix7/lib -L/informix7/lib/esql -losshr -lgenshr > -lsqlshr > > ld: 0711-317 ERROR: Undefined symbol: .sqli_connect_open > ld: 0711-317 ERROR: Undefined symbol: .sqli_prep > ld: 0711-317 ERROR: Undefined symbol: .sqli_curs_locate > ld: 0711-317 ERROR: Undefined symbol: .sqli_curs_decl_dynm > ld: 0711-317 ERROR: Undefined symbol: .sqli_connect_close > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more > information. > collect2: ld returned 8 exit status > make: 1254-004 The error code from the last command is 1. > > > Stop. Informix libs are missing. Execute esql -libs to see informix and OS libs for linking. informix@sb150:/opt/informix/CSDK281UC2R1 bin/esql -libs -lifsql -lifasf -lifgen -lifos -lifgls -lnsl -lsocket -laio -lm -ldl -lelf /opt/informix/IDS940UC2/lib/esql/checkapi.o -lifglx informix@sb150:/opt/informix/CSDK281UC2R1 Regards Frank