Re: compile a program
Posted in 1999
jjdai@hotmail.com wrote: > > Hi Friends , > > I face a problem when I read others source-code and try to re-compile > this program , > I have checked the makefile and try to file some thread , but it seems > ok , > the compile system alway told me : > /usr/ccs/bin/ld: Unsatisfied symbols: > S_Trim (code) > MQ_SetOption (code) > MQ_QInit (code) > MQ_Disconnect (code) > MQ_Connect (code) > MQ_RequestReply (code) > CFG_GetConfigValue (code) > CFG_ReadConfig (code) > LG_Log (code) > *** Error exit code 1 > > I check the makefile and find that > LIBS = -L$(TSS_ROOT)/lib \\ > ltdl -lrmi -lcibi -ltibQ -lgdss -lesa - > lqlsysut\\ > -lmsa -lchan -lmdss -lciutil -lutil \\ > -lqlutil -lnsl > LOCAL_LIBS = -L$(TOP)/util/lib -L$(TOP)/tib/lib -ltibapi -lctglib > > ECFLAGS= -o call_plc.exe $(CFLAGS) $(HPUXCFLAGS) > GLIBS=$(CTGTIBLIBDIR)/libtibapi.a $(CTGUTLLIBDIR)/libctglib.a $(LIBS) \\ > -L$(LCLLIBDIR) -lskpkg > > call_plc.exe: call_plc.o > c4gl $(ECFLAGS) plclient.ec call_plc.c Since the missing functions are not standard Informix functions, the link line above should presumably reference some or all of the myriad libraries listed in LIBS and LOCAL_LIBS and GLIBS. > have been defined and referenced correctly , so how can I find the > question furtherly ? > > by the way I have a related problem about this : > how can I konw the calls in a library (.a) file , how can I > reference a function implemented in > a library(.a file) (I am not an expert of c programming) You find out what is in the library using the nm command. There are a variety of formats, so you'll have to look at your system's manual. You reference a fuction in a library by writing a call to it in the code you compile (normally; you can also use the function name to initialize a pointer to a function, which might or might not ever be used to call the function; you can also have fun with dynamically loaded libraries). -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN #include <disclaimer.h>