Re: esql library and header files - compile/link problem
Posted in 2006
I'm still having problems. I took your advice and separately compile the esqlC code and the unixODBC code. Wheh I attempt to link,I get an error - see below. [kcj@kylie examples]$ esql -o program cus.o main_kcj.o -L/usr/local/easysoft/un ixODBC/lib -L/usr/local/easysoft/oob/client -lodbc /usr/bin/ld: skipping incompatible /usr/local/easysoft/unixODBC/lib/libodbc.so when searching for -lodbc /usr/bin/ld: cannot find -lodbc collect2: ld returned 1 exit status Before all this I was compiling and linking the odbc code with the following makefile -------- CC=cc -m32 -B/usr/lib/i386-redhat-linux3E/lib/ INSTALLPATH=/usr/local EXTRALIBS=-lesrpc -lessupp -lesextra LDPATH=-L ${INSTALLPATH}/easysoft/lib -L${INSTALLPATH}/easysoft/oob/client -L${I NSTALLPATH}/easysoft/unixODBC/lib INCPATH=${INSTALLPATH}/easysoft/oob/client/include CFLAGS=-g -I${INCPATH} cus : cus.o ${CC} ${CFLAGS} -o cus cus.o ${LDPATH} \\ -lodbc clean : rm -f *.o rm -f cus ---------- Note I'm using m32 option. I set INFORMIXC so that this is also used in compiling the esql C object. ANY clues/help/answers most appreciated!!!! Kate Jonathan Leffler wrote: > On 30 Jun 2006 13:12:46 -0700, kjuliff@gmail.com <kjuliff@gmail.com> wrote: > > I am trying to create an esql program BUT within it I need to open and > > close a UNIXodbc datasource. Because of this I'm having problems. > > > > I can compile EITHER eqsl OR the ODBC code but I do'nt know how to put > > them together. > > > > What would be the best approach? > > cc -I/usr/unixodbc/include -c odbcfile.c > esql -c esqlfile.ec > esql -o program odbcfile.o esqlfile.o -L/usr/unixodbc/lib -lodbc > > What this does is compiles the ESQL/C source with the ESQL/C compiler. > It compiles the ODBC source with the correct ODBC headers. > It links the ESQL/C object and the ODBC object with the ESQL/C > libraries (supplied implicitly by the esql script) and the ODBC > libraries (specified on the command line). If, perchance, you had an > ODBC compiler script instead of just using the C compiler direct, > you'd tell ESQL/C that the 'C compiler' was the hypothetical but > implausible ODBC compiler script by setting INFORMIXC=odbcc in the > environment. > > Did you try this? What was the trouble? > > -- > Jonathan Leffler #include <disclaimer.h> > Email: jleffler@earthlink.net, jleffler@us.ibm.com > Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/