Unix Technical Forum

esql library and header files - compile/link problem

This is a discussion on esql library and header files - compile/link problem within the Informix forums, part of the Database Server Software category; --> I am trying to create an esql program BUT within it I need to open and close a UNIXodbc ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 12:28 PM
kjuliff@gmail.com
 
Posts: n/a
Default esql library and header files - compile/link problem

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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 12:28 PM
Jonathan Leffler
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

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/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 12:30 PM
kjuliff@gmail.com
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

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/


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 12:30 PM
Jonathan Leffler
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

On 6 Jul 2006 14:03:07 -0700, kjuliff@gmail.com <kjuliff@gmail.com> wrote:
> 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


OK. Did you compile the ODBC library? I assume not given the
location, but there used to be an Open Source project called UnixODBC,
so it isn't clear either way.

It appears that you have a file
/usr/local/easysoft/unixODBC/lib/libodbc.so, but that file is not the
same sort of shared library as the C compiler (actually, loader,
/usr/bin/ld) plus options is expecting to use. So, which version of
ESQL/C are you using? What does file on the ODBC library say? What
does it say on /lib/libc.so (or /usr/lib/libc.so) and what does it say
on $INFORMIXDIR/lib/esql/lib*.so? If the answer is significantly
different in some respect, we've probably got to the immediate problem
- and you're likely to have to change the ESQL/C or ODBC versions so
that the libraries are compatible. Which is easier depends on what
you've got and what the difference is. In particular, if one of the
ODBC or ESQL/C libraries is similar to the C library but the other is
different, it is going to be easier to fix the one that is different.


> 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}


It might be informative to run the ESQL/C compiler (as the loader)
with the environment variable INFORMIXC="echo cc". This should echo
the C compiler command line that invokes the loader, and that will
allow us to compare with what you had before.

Are we to infer that you previously got just the ODBC code to link
cleanly? The problem only arose when you tried to add ESQL/C to the
program too?

> 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/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-20-2008, 12:31 PM
kjuliff@gmail.com
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

Yes - I can complile and link the odbc code (with the makefile shown
below).

I did as you suggested witth the echo.

I get
from this command line


this outut

esql -m32 -o program cus.o main_kcj.o
-L/usr/local/easysoft/unixODBC/lib -L/usr/local/easysoft/oob/client
-lodbc

cc -I/usr/informix/incl/esql -m32 -o program cus.o main_kcj.o
-L/usr/local/easysoft/unixODBC/lib -L/usr/local/easysoft/oob/client
-lodbc -L/usr/informix/lib -L/usr/informix/lib/esql -lifsql -lifasf
-lifgen -lifos -lifgls -lm -ldl -lcrypt /u
sr/informix/lib/esql/checkapi.o -lifglx


So it seems it is looking in informix libraries and skipping the
easysoft ones.

With the makefile I used for the odbc compile and link I had set
LDPATH. But the esql linker wouldn't use this????











Jonathan Leffler wrote:
> On 6 Jul 2006 14:03:07 -0700, kjuliff@gmail.com <kjuliff@gmail.com> wrote:
> > 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

>
> OK. Did you compile the ODBC library? I assume not given the
> location, but there used to be an Open Source project called UnixODBC,
> so it isn't clear either way.
>
> It appears that you have a file
> /usr/local/easysoft/unixODBC/lib/libodbc.so, but that file is not the
> same sort of shared library as the C compiler (actually, loader,
> /usr/bin/ld) plus options is expecting to use. So, which version of
> ESQL/C are you using? What does file on the ODBC library say? What
> does it say on /lib/libc.so (or /usr/lib/libc.so) and what does it say
> on $INFORMIXDIR/lib/esql/lib*.so? If the answer is significantly
> different in some respect, we've probably got to the immediate problem
> - and you're likely to have to change the ESQL/C or ODBC versions so
> that the libraries are compatible. Which is easier depends on what
> you've got and what the difference is. In particular, if one of the
> ODBC or ESQL/C libraries is similar to the C library but the other is
> different, it is going to be easier to fix the one that is different.
>
>
> > 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}

>
> It might be informative to run the ESQL/C compiler (as the loader)
> with the environment variable INFORMIXC="echo cc". This should echo
> the C compiler command line that invokes the loader, and that will
> allow us to compare with what you had before.
>
> Are we to infer that you previously got just the ODBC code to link
> cleanly? The problem only arose when you tried to add ESQL/C to the
> program too?
>
> > 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/


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-20-2008, 12:31 PM
kjuliff@gmail.com
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

I believe libifsql.co is the problem. It is looking at the 64 bit lib.
But IS there a 32 bit one?
kjuliff@gmail.com wrote:
> Yes - I can complile and link the odbc code (with the makefile shown
> below).
>
> I did as you suggested witth the echo.
>
> I get
> from this command line
>
>
> this outut
>
> esql -m32 -o program cus.o main_kcj.o
> -L/usr/local/easysoft/unixODBC/lib -L/usr/local/easysoft/oob/client
> -lodbc
>
> cc -I/usr/informix/incl/esql -m32 -o program cus.o main_kcj.o
> -L/usr/local/easysoft/unixODBC/lib -L/usr/local/easysoft/oob/client
> -lodbc -L/usr/informix/lib -L/usr/informix/lib/esql -lifsql -lifasf
> -lifgen -lifos -lifgls -lm -ldl -lcrypt /u
> sr/informix/lib/esql/checkapi.o -lifglx
>
>
> So it seems it is looking in informix libraries and skipping the
> easysoft ones.
>
> With the makefile I used for the odbc compile and link I had set
> LDPATH. But the esql linker wouldn't use this????
>
>
>
>
>
>
>
>
>
>
>
> Jonathan Leffler wrote:
> > On 6 Jul 2006 14:03:07 -0700, kjuliff@gmail.com <kjuliff@gmail.com> wrote:
> > > 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

> >
> > OK. Did you compile the ODBC library? I assume not given the
> > location, but there used to be an Open Source project called UnixODBC,
> > so it isn't clear either way.
> >
> > It appears that you have a file
> > /usr/local/easysoft/unixODBC/lib/libodbc.so, but that file is not the
> > same sort of shared library as the C compiler (actually, loader,
> > /usr/bin/ld) plus options is expecting to use. So, which version of
> > ESQL/C are you using? What does file on the ODBC library say? What
> > does it say on /lib/libc.so (or /usr/lib/libc.so) and what does it say
> > on $INFORMIXDIR/lib/esql/lib*.so? If the answer is significantly
> > different in some respect, we've probably got to the immediate problem
> > - and you're likely to have to change the ESQL/C or ODBC versions so
> > that the libraries are compatible. Which is easier depends on what
> > you've got and what the difference is. In particular, if one of the
> > ODBC or ESQL/C libraries is similar to the C library but the other is
> > different, it is going to be easier to fix the one that is different.
> >
> >
> > > 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}

> >
> > It might be informative to run the ESQL/C compiler (as the loader)
> > with the environment variable INFORMIXC="echo cc". This should echo
> > the C compiler command line that invokes the loader, and that will
> > allow us to compare with what you had before.
> >
> > Are we to infer that you previously got just the ODBC code to link
> > cleanly? The problem only arose when you tried to add ESQL/C to the
> > program too?
> >
> > > 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/


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-20-2008, 12:31 PM
kjuliff@gmail.com
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

Got it working

cc -m32 -o program cus.o main_kcj.o -L/usr/local/easysoft/unixODBC/lib
-/usr/local/easysoft/oob/client -lodbc -B/usr/lib/i386-redhat-li
nux3E/lib/

worked when ec prog compiled with this env

TERMCAP=/etc/termcap
INFORMIXTERM=terminfo
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R
6/bin:/home/kcj/bin:/usr/informix/bin:/usr/local/easysoft/isam/bin:.
MAIL=/var/spool/mail/kcj
PWD=/usr/local/easysoft/oob/examples
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/root
SHLVL=2
INFORMIXSERVER=pic_ids
TERMINFO=/usr/lib/terminfo
CFLAGS=-m32 -g
LOGNAME=kcj
INFORMIXC=cc -m32
LESSOPEN=|/usr/bin/lesspipe.sh %s
LDPATH=-L/usr/local/easysoft/unixODBC/lib
-L/usr/local/easysoft/oob/client -lodb
c -B/usr/lib/i386-redhat-linux3E/lib/
G_BROKEN_FILENAMES=1

and this complie for the esql object

esql -c main_kcj.ec

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-20-2008, 12:31 PM
kjuliff@gmail.com
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

I spoke to soon. Of course it DOESN'T work. It linked OK with my
example, but my esql program did not use any esql statements. When I
add them in, the esql statements cannot resilve. Back to square 1!!!!

Can anybody help. I do NOT want to install 32bit esql and I need the
odbc to use 32 bit!


kjuliff@gmail.com wrote:
> Got it working
>
> cc -m32 -o program cus.o main_kcj.o -L/usr/local/easysoft/unixODBC/lib
> -/usr/local/easysoft/oob/client -lodbc -B/usr/lib/i386-redhat-li
> nux3E/lib/
>
> worked when ec prog compiled with this env
>
> TERMCAP=/etc/termcap
> INFORMIXTERM=terminfo
> PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R
> 6/bin:/home/kcj/bin:/usr/informix/bin:/usr/local/easysoft/isam/bin:.
> MAIL=/var/spool/mail/kcj
> PWD=/usr/local/easysoft/oob/examples
> INPUTRC=/etc/inputrc
> LANG=en_US.UTF-8
> SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
> HOME=/root
> SHLVL=2
> INFORMIXSERVER=pic_ids
> TERMINFO=/usr/lib/terminfo
> CFLAGS=-m32 -g
> LOGNAME=kcj
> INFORMIXC=cc -m32
> LESSOPEN=|/usr/bin/lesspipe.sh %s
> LDPATH=-L/usr/local/easysoft/unixODBC/lib
> -L/usr/local/easysoft/oob/client -lodb
> c -B/usr/lib/i386-redhat-linux3E/lib/
> G_BROKEN_FILENAMES=1
>
> and this complie for the esql object
>
> esql -c main_kcj.ec


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-20-2008, 12:31 PM
Jonathan Leffler
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

On 7 Jul 2006 10:39:16 -0700, kjuliff@gmail.com <kjuliff@gmail.com> wrote:
> I spoke to soon. Of course it DOESN'T work. It linked OK with my
> example, but my esql program did not use any esql statements. When I
> add them in, the esql statements cannot resilve. Back to square 1!!!!
>
> Can anybody help. I do NOT want to install 32bit esql and I need the
> odbc to use 32 bit!


Well, don't let us stop you from writing your own loader and runtime
system so that you can mix 32-bit object code with 64-bit object code
and have it all miraculously work, but...

No-one in the industry that I'm aware of has done so in a successful
commercial or open source implementation. If you have 32-bit object
code for some portion of your program, you need 32-bit object code for
all of your program. Or, you can choose to use 64-bit object for the
whole program. But you cannot have a mixture in any
commercially/generally available system.

So, you need to make a decision - is it easier to obtain 64-bit ODBC
libraries etc, or to install 32-bit CSDK? I suspect that 32-bit CSDK
is the less painful option. Install it in a separate INFORMIXDIR from
your 64-bit Informix software. But it is your call.

And please - next time you ask a question - include full version
information up front. If you'd said you had a 32-bit ODBC library and
ESQL/C 2.90.FCx, I would have been able to put you on the right path a
lot quicker - and without feeling unremosrseful about the jibes above.
Version numbers are critical to getting accurate help swiftly.

http://www.catb.org/~esr/faqs/smart-questions.html



> kjuliff@gmail.com wrote:
> > Got it working
> >
> > cc -m32 -o program cus.o main_kcj.o -L/usr/local/easysoft/unixODBC/lib
> > -/usr/local/easysoft/oob/client -lodbc -B/usr/lib/i386-redhat-li
> > nux3E/lib/
> >
> > worked when ec prog compiled with this env
> >
> > TERMCAP=/etc/termcap
> > INFORMIXTERM=terminfo
> > PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R
> > 6/bin:/home/kcj/bin:/usr/informix/bin:/usr/local/easysoft/isam/bin:.
> > MAIL=/var/spool/mail/kcj
> > PWD=/usr/local/easysoft/oob/examples
> > INPUTRC=/etc/inputrc
> > LANG=en_US.UTF-8
> > SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
> > HOME=/root
> > SHLVL=2
> > INFORMIXSERVER=pic_ids
> > TERMINFO=/usr/lib/terminfo
> > CFLAGS=-m32 -g
> > LOGNAME=kcj
> > INFORMIXC=cc -m32
> > LESSOPEN=|/usr/bin/lesspipe.sh %s
> > LDPATH=-L/usr/local/easysoft/unixODBC/lib
> > -L/usr/local/easysoft/oob/client -lodb
> > c -B/usr/lib/i386-redhat-linux3E/lib/
> > G_BROKEN_FILENAMES=1
> >
> > and this complie for the esql object
> >
> > esql -c main_kcj.ec




--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-20-2008, 12:31 PM
Art S. Kagel
 
Posts: n/a
Default Re: esql library and header files - compile/link problem

kjuliff@gmail.com wrote:
> I spoke to soon. Of course it DOESN'T work. It linked OK with my
> example, but my esql program did not use any esql statements. When I
> add them in, the esql statements cannot resilve. Back to square 1!!!!
>
> Can anybody help. I do NOT want to install 32bit esql and I need the
> odbc to use 32 bit!


It cannot be done! You cannot link 32bit and 64bit code together. The best
you could do would be to create two cooperating tasks, a 32bit odbc app and
a 64bit esql app, and have them pass data between them using pipes or
message queues, database tables, or something else. But they would have to
be independently linked complete applications.

Or just break down and install 32bit ESQL/C in a separate directory for
linking this one application and others like it. You can still use pure
64bit ESQL/C for pure esql apps.

Art S. Kagel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:16 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com