I have a c program that is compiling fine and giving me linking errors. The funcions that it lists are defined, and I can't figure out why it says that it cannot find them. I will post the 1. The error, 2. The makefile, and you'll have to take my word that the funcions are in the source, and come before the main program! All help is appreciated!
ld): halt 4
(ld): savename wbin
(ld): filelist 10 1
(ld): i /lib/crt0.o
(ld): i wb_fields.o
(ld): i wb_log.o
(ld): i wb_import.o
(ld): lib /cas/lib/libutl.a
(ld): lib /cas/lib/libdb.a
(ld): lib /cas/lib/libsqlc.a
(ld): lib /cas/lib/libcate.a
(ld): i /cas/lib/pp_cat.o
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libc.a[shr.o]: 2172 symbols imported.
LIBRARY: Shared object libc.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libc.a[aio.o]: 11 symbols imported.
LIBRARY: Shared object libc.a[pse.o]: 78 symbols imported.
LIBRARY: Shared object libc.a[dl.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty.o]: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 10
(ld): resolve
RESOLVE: 151 of 4053 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 38 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
RLD: Address Section Rld-type Referencing Symbol
----------------------------------------------------------------------------------------------
._iqslct [206] ER PR wb_import.c(wb_import.o)
00000c9c .text R_RBR [22] .ProcessBadgeRecords
00001c08 .text R_RBR [34] .UpdateBadge
00001d14 .text R_RBR [34] .UpdateBadge
00002a3c .text R_RBR [44] .CreateNewBarcodeBadge
00002e48 .text R_RBR [44] .CreateNewBarcodeBadge
._iqdbase [208] ER PR wb_import.c(wb_import.o)
00000db8 .text R_RBR [24] .OpenDatabase
sqlca [114] ER UA wb_import.c(wb_import.o)
00003690 .data R_POS [116] <sqlca>
._iqdbclose [212] ER PR wb_import.c(wb_import.o)
00001090 .text R_RBR [30] .CloseDatabase
._iqnprep [214] ER PR wb_import.c(wb_import.o)
000012c0 .text R_RBR [32] .UpdateProxBadgeStatus
************************************************************************************************************
.SUFFIXES:
.SUFFIXES: .o .ec .ec~
.SUFFIXES: .o .c .c~
OTHERINC = /opt/informix/incl/esql:/opt/informix
OTHERLD = /opt/informix/lib -bnoquiet
INFORM = $(INFORMIXDIR)
ECC = $(INFORM)/bin/esql -e
LIBS = -lutl -ldb -lsqlc -lutl -ldb -lcate $(ROOT)/cas/lib/pp_cat.o $(INFORMIXLIB) $(MISCLIB)
CFLAGS = -c $(DEBUG) -I$(ROOT)/cas/src/include -I. $(INFORMIXINC) $(MISCINC) -I$(CATINCL)/$(LANG) -I$(OTHERINC)
LDFLAGS = $(DEBUG) -L$(ROOT)/cas/lib $(EXTLDFLAGS) -L/$(OTHERLD)
OBJS = wb_fields.o wb_log.o wb_import.o
all: wbin
default: wbin
install: all
@cp wbin $(ROOT)/cas/bin
@cp wbout $(ROOT)/cas/bin
@cp wb.txt $(ROOT)/cas/db/text
wbin: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
.ec.o:
$(ECC) $*.ec
@mv $*.c esqltemp.c
$(CC) -c $(CFLAGS) esqltemp.c
@mv esqltemp.o $*.o
@rm esqltemp.c
.c.o:
$(CC) $(CFLAGS) $*.c
clean:
@rm -f $(OBJS)
@echo "Cleanup complete."
clobber: clean
As always, I hope that helped!
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
ld): halt 4
(ld): savename wbin
(ld): filelist 10 1
(ld): i /lib/crt0.o
(ld): i wb_fields.o
(ld): i wb_log.o
(ld): i wb_import.o
(ld): lib /cas/lib/libutl.a
(ld): lib /cas/lib/libdb.a
(ld): lib /cas/lib/libsqlc.a
(ld): lib /cas/lib/libcate.a
(ld): i /cas/lib/pp_cat.o
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libc.a[shr.o]: 2172 symbols imported.
LIBRARY: Shared object libc.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libc.a[aio.o]: 11 symbols imported.
LIBRARY: Shared object libc.a[pse.o]: 78 symbols imported.
LIBRARY: Shared object libc.a[dl.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty.o]: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 10
(ld): resolve
RESOLVE: 151 of 4053 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 38 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
RLD: Address Section Rld-type Referencing Symbol
----------------------------------------------------------------------------------------------
._iqslct [206] ER PR wb_import.c(wb_import.o)
00000c9c .text R_RBR [22] .ProcessBadgeRecords
00001c08 .text R_RBR [34] .UpdateBadge
00001d14 .text R_RBR [34] .UpdateBadge
00002a3c .text R_RBR [44] .CreateNewBarcodeBadge
00002e48 .text R_RBR [44] .CreateNewBarcodeBadge
._iqdbase [208] ER PR wb_import.c(wb_import.o)
00000db8 .text R_RBR [24] .OpenDatabase
sqlca [114] ER UA wb_import.c(wb_import.o)
00003690 .data R_POS [116] <sqlca>
._iqdbclose [212] ER PR wb_import.c(wb_import.o)
00001090 .text R_RBR [30] .CloseDatabase
._iqnprep [214] ER PR wb_import.c(wb_import.o)
000012c0 .text R_RBR [32] .UpdateProxBadgeStatus
************************************************************************************************************
.SUFFIXES:
.SUFFIXES: .o .ec .ec~
.SUFFIXES: .o .c .c~
OTHERINC = /opt/informix/incl/esql:/opt/informix
OTHERLD = /opt/informix/lib -bnoquiet
INFORM = $(INFORMIXDIR)
ECC = $(INFORM)/bin/esql -e
LIBS = -lutl -ldb -lsqlc -lutl -ldb -lcate $(ROOT)/cas/lib/pp_cat.o $(INFORMIXLIB) $(MISCLIB)
CFLAGS = -c $(DEBUG) -I$(ROOT)/cas/src/include -I. $(INFORMIXINC) $(MISCINC) -I$(CATINCL)/$(LANG) -I$(OTHERINC)
LDFLAGS = $(DEBUG) -L$(ROOT)/cas/lib $(EXTLDFLAGS) -L/$(OTHERLD)
OBJS = wb_fields.o wb_log.o wb_import.o
all: wbin
default: wbin
install: all
@cp wbin $(ROOT)/cas/bin
@cp wbout $(ROOT)/cas/bin
@cp wb.txt $(ROOT)/cas/db/text
wbin: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
.ec.o:
$(ECC) $*.ec
@mv $*.c esqltemp.c
$(CC) -c $(CFLAGS) esqltemp.c
@mv esqltemp.o $*.o
@rm esqltemp.c
.c.o:
$(CC) $(CFLAGS) $*.c
clean:
@rm -f $(OBJS)
@echo "Cleanup complete."
clobber: clean
As always, I hope that helped!
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.