an exotic problem with CLI
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues, Internationalization & Character Sets
Hi all, I have been trying to write a short C program that connects to Informix db using CLI functions. There seems to be quite a strange problem... I use MakeFile to link my program with appropriate libraries as follows: "-L$INFORMIXDIR/lib/cli -lifcli" "-L$INFORMIXDIR/lib/esql -lifgls -lifglx". I didn't know that Informix CLI needs gls/glx libraries from the ESQL directory but the compiler demanded them. When I added a link to these library files the compiler was happy and my program was compiled OK. However when I try run the program I get the following error: /usr/lib/dld.sl: Can't open shared library ./libifglx.sl /usr/lib/dls.sl : No such file or dirtory It seems to look the "libifglx.sl" file from the CURRENT directory though the library path was defined correctly in my Makefile. I also used "chatr" command to see the shared library list and there really is "$INFORMIXDIR/esql/lib/libifcli.sl". So how on earth it looks for "./libifglx.sl"? And how is it possible that this type of error occurs in runtime and not in compile time? Could anybody give any idea what's possibly wrong? I would be very happy for any comments. Best Recards Katja Heikkinen Finland ps. I run Informix 7.31 on HP-UX 11.00, my compiler is HP-UX aCC Sent via Deja.com http://www.deja.com/ Before you buy.
The system is always right.
At runtime because
it's using a shared/dynamic library (that .sl extention) and the error
is reported by the dld.sl(dynamic function calls to load dynamic functions).
Then how to tell the system at runtime where to look for the library ?
I don't know HP very well, but I would try
export INFORMIXDIR=where everexport
LD_LIBRARY_PATH=$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib:$LD_LIBRARY_PATH
export PATH=$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib:$PATH
try a man cc to make shure. it should tell you the search order for Dynamic
Link Librarys on your system
heikkka4@my-deja.com wrote:
> Hi all,
>
> I have been trying to write a short C program that connects to Informix
> db using CLI functions. There seems to be quite a strange problem...
>
> I use MakeFile to link my program with appropriate libraries as follows:
>
> "-L$INFORMIXDIR/lib/cli -lifcli"
> "-L$INFORMIXDIR/lib/esql -lifgls -lifglx".
>
> I didn't know that Informix CLI needs gls/glx libraries from the ESQL
> directory but the compiler demanded them. When I added a link to these
> library files the compiler was happy and my program was compiled OK.
>
> However when I try run the program I get the following error:
> /usr/lib/dld.sl: Can't open shared library ./libifglx.sl
> /usr/lib/dls.sl : No such file or dirtory
>
> It seems to look the "libifglx.sl" file from the CURRENT directory
> though the library path was defined correctly in my Makefile. I also
> used "chatr" command to see the shared library list and
> there really is "$INFORMIXDIR/esql/lib/libifcli.sl". So how on earth
> it looks for "./libifglx.sl"? And how is it possible that this
> type of error occurs in runtime and not in compile time?
>
> Could anybody give any idea what's possibly wrong? I would be
> very happy for any comments.
>
> Best Recards
>
> Katja Heikkinen
> Finland
>
> ps. I run Informix 7.31 on HP-UX 11.00, my compiler is HP-UX aCC
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Thank you, Mathias, very much for replying.
My all environment variables are set as you adviced (SHLIB_PATH is a HP
equivalent to LD_LIBRARY_PATH I presume)
I understand that library functions are loaded at run time. But there
is still something I don't understand:
When I use aCC linker to link library files to my program the compiler
checks that the library files are really there. If I change the -L
option to point to a wrong directory, the compiler returns an error:
"/usr/css/bin/ld: Can't find library for -lifglx" When I correct
the library path the compiler is happy again.
So why the compiler finds the library file but the executable program
does not?
I have though that the HP linker writes library path information to a
executable file. When I examine the executable program file with
"chatr" command the output is as follows:
shared library list:
dynamic /informix/lib/libifcli.sl
dynamic /informix/lib/esql/libifgls.sl
...
shared library binding:
immediate
Your comments?
Best regards
Katja
In article <38D8B835.10D645C2@emc.com>,
Mathias =?iso-8859-1?Q?Br=E4ckow?= <braeckow_mathias@emc.com> wrote:
> The system is always right.
> At runtime because
> it's using a shared/dynamic library (that .sl extention) and the error
> is reported by the dld.sl(dynamic function calls to load dynamic
functions).
>
> Then how to tell the system at runtime where to look for the library ?
> I don't know HP very well, but I would try
>
> export INFORMIXDIR=where ever> export
>
LD_LIBRARY_PATH=$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib:$LD_LIBRARY_PATH
> export PATH=$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib:$PATH>
> try a man cc to make shure. it should tell you the search order for
Dynamic
> Link Librarys on your system
>
> heikkka4@my-deja.com wrote:
>
> > Hi all,
> >
> > I have been trying to write a short C program that connects to
Informix
> > db using CLI functions. There seems to be quite a strange problem...
> >
> > I use MakeFile to link my program with appropriate libraries as
follows:
> >
> > "-L$INFORMIXDIR/lib/cli -lifcli"
> > "-L$INFORMIXDIR/lib/esql -lifgls -lifglx".
> >
> > I didn't know that Informix CLI needs gls/glx libraries from the
ESQL
> > directory but the compiler demanded them. When I added a link to
these
> > library files the compiler was happy and my program was compiled OK.
> >
> > However when I try run the program I get the following error:
> > /usr/lib/dld.sl: Can't open shared library ./libifglx.sl
> > /usr/lib/dls.sl : No such file or dirtory
> >
> > It seems to look the "libifglx.sl" file from the CURRENT directory
> > though the library path was defined correctly in my Makefile. I also
> > used "chatr" command to see the shared library list and
> > there really is "$INFORMIXDIR/esql/lib/libifcli.sl". So how on earth
> > it looks for "./libifglx.sl"? And how is it possible that this
> > type of error occurs in runtime and not in compile time?
> >
> > Could anybody give any idea what's possibly wrong? I would be
> > very happy for any comments.
> >
> > Best Recards
> >
> > Katja Heikkinen
> > Finland
> >
> > ps. I run Informix 7.31 on HP-UX 11.00, my compiler is HP-UX aCC
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
try setting SHMLIB before running the program. Nona >Subject: an exotic problem with CLI >From: heikkka4@my-deja.com >Date: 22.03.00 12:44 W. Europe Standard Time >Message-id: <8babm3$j2k$1@nnrp1.deja.com> > >Hi all, > >I have been trying to write a short C program that connects to Informix >db using CLI functions. There seems to be quite a strange problem... > >I use MakeFile to link my program with appropriate libraries as follows: > >"-L$INFORMIXDIR/lib/cli -lifcli" >"-L$INFORMIXDIR/lib/esql -lifgls -lifglx". > >I didn't know that Informix CLI needs gls/glx libraries from the ESQL >directory but the compiler demanded them. When I added a link to these >library files the compiler was happy and my program was compiled OK. > >However when I try run the program I get the following error: >/usr/lib/dld.sl: Can't open shared library ./libifglx.sl >/usr/lib/dls.sl : No such file or dirtory > >It seems to look the "libifglx.sl" file from the CURRENT directory >though the library path was defined correctly in my Makefile. I also >used "chatr" command to see the shared library list and >there really is "$INFORMIXDIR/esql/lib/libifcli.sl". So how on earth >it looks for "./libifglx.sl"? And how is it possible that this >type of error occurs in runtime and not in compile time? > >Could anybody give any idea what's possibly wrong? I would be >very happy for any comments. > >Best Recards > >Katja Heikkinen >Finland > >ps. I run Informix 7.31 on HP-UX 11.00, my compiler is HP-UX aCC > > > > > > > >Sent via Deja.com http://www.deja.com/ >Before you buy. > > > > > >
Related threads
- Conversion to differeent characters sets
- Problem in changing locale via dbexport/dbimport
- RE: openlink error "Unable to load locale categories"