1753878 Members
7142 Online
108809 Solutions
New Discussion юеВ

ld: Unsatisfied symbol

 
JaganKumar
Advisor

ld: Unsatisfied symbol

while trying to make our application exe's i am getting unsatisfied symbol.

here is the linker, compiler flag and the make command.
CFLAGS=+DD32 -Aa +z -I../include -I$(ODL)/include -I$(SYBASE)/ASE-15_0/include -I/pkg1/sybase_base/OCS-15_0/include $(DEBUG) -lc
LPATH= LPATH=../bin:$(ODL)/bin:$(SYBASE)/OCS-15_0/lib:/lib:/usr/lib/hpux32

../bin/libnewfab.sl : $(OBJS)
$(LPATH) ld -b -E +s $(OBJS) \
-lsybdb -lodlsyb -lcurses -lmont -o $@

../bin/fabrpt : fabrpt.c
$(LPATH) cc $(CFLAGS) fabrpt.c \
-lnewfab -lods -lpctl -lpkts -lcom -ltools -lodlsyb -lsybdb -lmont \
-ldld -Wl,+s -o $@

and i am getting 62 error stating unsatisfied symbols
ld: Unsatisfied symbol "mtraceSqlLogger" in file fabrpt.o
ld: Unsatisfied symbol "WorkList" in file fabrpt.o
ld: Unsatisfied symbol "TempDb" in file fabrpt.o
ld: Unsatisfied symbol "stRender" in file fabrpt.o
ld: Unsatisfied symbol "ItemFileSize" in file fabrpt.o
ld: Unsatisfied symbol "sno" in file fabrpt.o
ld: Unsatisfied symbol "dbbind" in file fabrpt.o
ld: Unsatisfied symbol "GetSubrName" in file fabrpt.o
ld: Unsatisfied symbol "xmlOrdrNbr" in file fabrpt.o
ld: Unsatisfied symbol "mtraceInitMain" in file fabrpt.o
ld: Unsatisfied symbol "retCode" in file fabrpt.o
ld: Unsatisfied symbol "strcmpi" in file fabrpt.o

i hope we are properly linking the lib which we make as part of this make.

Please help me in this regard.
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: ld: Unsatisfied symbol

Where do you think these symbols are defined?

If your libs are archives, you may have to use -Wl,+n or reorder them. This occurs if -lmont needs a symbol from -lnewfab.
JaganKumar
Advisor

Re: ld: Unsatisfied symbol

These symbols are availble in libnewfab.sl which is part of our Make file.

lmont and lnewfab are present in same dir. Still we are getting this problem.

thanks for your comments.
Dennis Handly
Acclaimed Contributor

Re: ld: Unsatisfied symbol

>These symbols are availble in libnewfab.sl

If this is a shlib, there is no ordering problem.

So you need to prove those symbols are in your shlib and you didn't hide them.
$ elfdump -n .dynsym -s libnewfab.sl | fgrep -e mtraceSqlLogger -e WorkList

>$(LPATH) ld -b -E +s $(OBJS) \

Note: you should NOT be using LPATH. This is reserved for the compiler driver and emergencies. You should simply pass in multiple -L options.

Use: LIBS=-L../bin -L$(ODL)/bin -L$(SYBASE)/OCS-15_0/lib

And add this macro before your -l libs.