Re: linking errors in informix & c.
Posted in 1997
*** ALWAYS USE THE INFORMIX COMPILATION SCRIPTS TO COMPILE & LINK *** Correct LINK procedure: esql -o sim_errs -Ae -O sim_errs.o err_hndlr.a ../sys/fourgl.a \\ ../sys/libesql.a -lnsl_s -lm -lV3 I've removed all the CPP definitions because you are not compiling anything; you are just linking. I don't know that the -Ae option is needed, but it is probably safer to leave it there. Since you seem to have ESQL/C (you're using lib/esql/libos.a), you should not be trying to use the I4GL libraries at all, so I used the esql compiler script. Alternatively, you can use the c4gl script with no changes. Do not try to mix ESQL/C and I4GL libraries -- it will break, and probably sooner rather than later. I think that the libnsl_s.a, libm.a and libV3.a arguments should be specified with the abbreviated options, and they may be redundant because the esql (or c4gl) script will include them if necessary. One major advantage of doing the linking this way is that it will work with any version of Informix-ESQL/C known to mankind (from 1.10.00 through 9.10.UC1). The other major advantage (or maybe it is just a corollary of the other point) is that the link process won't change when you upgrade your version of ESQL/C. You appear to be using a 6.0x I4GL and a 7.1x (or, just possibly, 6.00) ESQL/C; I can tell because you'd either be using different libraries or getting different link errors if you were using other versions. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: mahuja@nyx10.cs.du.edu (Manish Ahuja) }Date: 30 Apr 1997 09:43:51 -0600 }X-Informix-List-Id: <news.37339> } }Here is a small problem. I am creating an executable "sim_errs". }This program is dependent on user dependant functions like }fourgl.a, err_hndlr.a. Apart from this, this file also links with }informix related libraries which is as shown below. The order of these }libraries appears to be in-appropiate. I would like to know the correct }order of these libraries so that the following or any other suggestions: }Compilation procedure is via make: } }Compile procedure : } } cc -o sim_errs -Ae -Dconst= -Dvolatile= -Dsigned= -I.. \\ } -I../sys -I/usr/informix/incl/tools -O -I/usr/include \\ } -Dhp9000s800 sim_errs.o err_hndlr.a ../sys/fourgl.a \\ } ../sys/libesql.a /usr/informix/lib/tools/lib4gl.a \\ } /usr/informix/lib/esql/libsql.a \\ } /usr/informix/lib/tools/netlib.a \\ } /usr/informix/lib/esql/libos.a \\ } /usr/informix/lib/tools/libasf.a \\ } /usr/informix/lib/esql/libgen.a /usr/lib/libnsl_s.a \\ } /usr/lib/libm.a /usr/lib/libV3.a }/usr/ccs/bin/ld: Unsatisfied symbols: } _oschkinternet (code) } _osnrclookup (code) } rbasename (code) } rdownshift (code) } _osrealdbn (code) } ggetcwd (code) } get_protocol_tab (code) }*** Error exit code 1 } }Thank you all in advance }sudupa@telesciences.com }mahuja@nyx.net