Re: error loading shared libraries
Posted in 2000
A compiled Informix 4GL program (.4ge) failed at runtime on one Linux server with "Error in loading shared libraries: lib4gsh730.so: cannot open shared object file", while the identical build ran fine on another box; recompiling and setting SHLIB_PATH (a SunOS-era variable) didn't help. Art Kagel suggested exporting LD_LIBRARY_PATH instead, which fixed it. The install script normally creates symlinks to the libraries in /usr/lib, so the variable isn't usually needed; Kagel and Jonathan Leffler also noted that adding /lib and /usr/lib to LD_LIBRARY_PATH is unnecessary (though putting /usr/lib first can speed library lookups).
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Thanks for your suggestion. I tried setting the SHLIB_PATH environment variable. That didn't help. The strange thing is that it works fine on one server. To test the theory that it may be the executable itself, I created a simple file with the following lines. database xxx main display "HELLO" end main and then compiled it as follows c4gl -o test1.4ge test1.4gl Ran the executable test1.4ge. Received the same exact error. I would greately appreciate any other suggestions you might have. Thanks J In article <8ggvqj$hu1$1@nnrp1.deja.com>, mars1972@my-deja.com wrote: > Did you check your environment? I don't know much about 4gl, but I've > seen similar problems if SHLIB_PATH is not set correctly. > > In article <8ggvch$hgk$1@nnrp1.deja.com>, > azteczenith@my-deja.com wrote: > > While executing a compiled 4ge executable I am getting the following > > error. > > "Error in loading shared libraries: lib4gsh730.so: cannot open shared > > object file: No such file or directory." > > > > I have two servers, the executable works on one but does not work on > > the other. I even recompiled on the new server. Compilation gives no > > error. But when I try and run it I get the error mentioned above. > > > > Has anyone seen this error before. > > Appreciate any help. > > > > Thanks > > > > J > > > > Sent via Deja.com http://www.deja.com/ > > Before you buy. > > > > -- > # unrm / > ksh: unrm: not found > # man cpio > > Sent via Deja.com http://www.deja.com/ > Before you buy. > Sent via Deja.com http://www.deja.com/ Before you buy.
I'm not sure I can help much more. I don't know much (anything) about 4gl. The only other thing I can think of to ask is if the runtime libraries are installed on both machines. They should be under ~informix/lib/, I would think. If that isn't it, perhaps someone else could shed more light than the dim glow I'm giving off right now... In article <8gh1k1$j96$1@nnrp1.deja.com>, azteczenith@my-deja.com wrote: > Thanks for your suggestion. I tried setting the SHLIB_PATH environment > variable. That didn't help. The strange thing is that it works fine on > one server. To test the theory that it may be the executable itself, I > created a simple file with the following lines. > > database xxx > main > display "HELLO" > end main > > and then compiled it as follows > > c4gl -o test1.4ge test1.4gl > > Ran the executable test1.4ge. Received the same exact error. > > I would greately appreciate any other suggestions you might have. > > Thanks > > J > > In article <8ggvqj$hu1$1@nnrp1.deja.com>, > mars1972@my-deja.com wrote: > > Did you check your environment? I don't know much about 4gl, but I've > > seen similar problems if SHLIB_PATH is not set correctly. > > > > In article <8ggvch$hgk$1@nnrp1.deja.com>, > > azteczenith@my-deja.com wrote: > > > While executing a compiled 4ge executable I am getting the following > > > error. > > > "Error in loading shared libraries: lib4gsh730.so: cannot open > shared > > > object file: No such file or directory." > > > > > > I have two servers, the executable works on one but does not work on > > > the other. I even recompiled on the new server. Compilation gives no > > > error. But when I try and run it I get the error mentioned above. > > > > > > Has anyone seen this error before. > > > Appreciate any help. > > > > > > Thanks > > > > > > J > > > > > > Sent via Deja.com http://www.deja.com/ > > > Before you buy. > > > > > > > -- > > # unrm / > > ksh: unrm: not found > > # man cpio > > > > Sent via Deja.com http://www.deja.com/ > > Before you buy. > > > > Sent via Deja.com http://www.deja.com/ > Before you buy. > -- # unrm / ksh: unrm: not found # man cpio Sent via Deja.com http://www.deja.com/ Before you buy.
Try exporting LD_LIBRARY_PATH, most systems use that to point to the shared library path. SHLIB_PATH is an old SunOS4 holdover. Art S. Kagel azteczenith@my-deja.com wrote: > > Thanks for your suggestion. I tried setting the SHLIB_PATH environment > variable. That didn't help. The strange thing is that it works fine on > one server. To test the theory that it may be the executable itself, I > created a simple file with the following lines. > > database xxx > main > display "HELLO" > end main > > and then compiled it as follows > > c4gl -o test1.4ge test1.4gl > > Ran the executable test1.4ge. Received the same exact error. > > I would greately appreciate any other suggestions you might have. > > Thanks > > J > > In article <8ggvqj$hu1$1@nnrp1.deja.com>, > mars1972@my-deja.com wrote: > > Did you check your environment? I don't know much about 4gl, but I've > > seen similar problems if SHLIB_PATH is not set correctly. > > > > In article <8ggvch$hgk$1@nnrp1.deja.com>, > > azteczenith@my-deja.com wrote: > > > While executing a compiled 4ge executable I am getting the following > > > error. > > > "Error in loading shared libraries: lib4gsh730.so: cannot open > shared > > > object file: No such file or directory." > > > > > > I have two servers, the executable works on one but does not work on > > > the other. I even recompiled on the new server. Compilation gives no > > > error. But when I try and run it I get the error mentioned above. > > > > > > Has anyone seen this error before. > > > Appreciate any help. > > > > > > Thanks > > > > > > J > > > > > > Sent via Deja.com http://www.deja.com/ > > > Before you buy. > > > > > > > -- > > # unrm / > > ksh: unrm: not found > > # man cpio > > > > Sent via Deja.com http://www.deja.com/ > > Before you buy. > > > > Sent via Deja.com http://www.deja.com/ > Before you buy.
Oops. Forgot about LD_LIBRARY_PATH... In article <392C3DBE.E7DE168A@bloomberg.net>, kagel@bloomberg.net wrote: > Try exporting LD_LIBRARY_PATH, most systems use that to point to the shared > library path. SHLIB_PATH is an old SunOS4 holdover. > > Art S. Kagel > > azteczenith@my-deja.com wrote: > > > > Thanks for your suggestion. I tried setting the SHLIB_PATH environment > > variable. That didn't help. The strange thing is that it works fine on > > one server. To test the theory that it may be the executable itself, I > > created a simple file with the following lines. > > > > database xxx > > main > > display "HELLO" > > end main > > > > and then compiled it as follows > > > > c4gl -o test1.4ge test1.4gl > > > > Ran the executable test1.4ge. Received the same exact error. > > > > I would greately appreciate any other suggestions you might have. > > > > Thanks > > > > J > > > > In article <8ggvqj$hu1$1@nnrp1.deja.com>, > > mars1972@my-deja.com wrote: > > > Did you check your environment? I don't know much about 4gl, but I've > > > seen similar problems if SHLIB_PATH is not set correctly. > > > > > > In article <8ggvch$hgk$1@nnrp1.deja.com>, > > > azteczenith@my-deja.com wrote: > > > > While executing a compiled 4ge executable I am getting the following > > > > error. > > > > "Error in loading shared libraries: lib4gsh730.so: cannot open > > shared > > > > object file: No such file or directory." > > > > > > > > I have two servers, the executable works on one but does not work on > > > > the other. I even recompiled on the new server. Compilation gives no > > > > error. But when I try and run it I get the error mentioned above. > > > > > > > > Has anyone seen this error before. > > > > Appreciate any help. > > > > > > > > Thanks > > > > > > > > J > > > > > > > > Sent via Deja.com http://www.deja.com/ > > > > Before you buy. > > > > > > > > > > -- > > > # unrm / > > > ksh: unrm: not found > > > # man cpio > > > > > > Sent via Deja.com http://www.deja.com/ > > > Before you buy. > > > > > > > Sent via Deja.com http://www.deja.com/ > > Before you buy. > -- # unrm / ksh: unrm: not found # man cpio Sent via Deja.com http://www.deja.com/ Before you buy.
Exporting LD_LIBRARY_PATH worked. Thanks for all your help guys. I really appreciate it. This User group has definitely been very helpful to me. I do have a question though. I did the install on another identical (at least I though they were identical) linux server. I did not have to export this variable. The programs worked fine without my having to export LD_LIBRARY_PATH. Why did I have to do it in this case. Regards J In article <392C3DBE.E7DE168A@bloomberg.net>, kagel@bloomberg.net wrote: > Try exporting LD_LIBRARY_PATH, most systems use that to point to the shared > library path. SHLIB_PATH is an old SunOS4 holdover. > > Art S. Kagel > > azteczenith@my-deja.com wrote: > > > > Thanks for your suggestion. I tried setting the SHLIB_PATH environment > > variable. That didn't help. The strange thing is that it works fine on > > one server. To test the theory that it may be the executable itself, I > > created a simple file with the following lines. > > > > database xxx > > main > > display "HELLO" > > end main > > > > and then compiled it as follows > > > > c4gl -o test1.4ge test1.4gl > > > > Ran the executable test1.4ge. Received the same exact error. > > > > I would greately appreciate any other suggestions you might have. > > > > Thanks > > > > J > > > > In article <8ggvqj$hu1$1@nnrp1.deja.com>, > > mars1972@my-deja.com wrote: > > > Did you check your environment? I don't know much about 4gl, but I've > > > seen similar problems if SHLIB_PATH is not set correctly. > > > > > > In article <8ggvch$hgk$1@nnrp1.deja.com>, > > > azteczenith@my-deja.com wrote: > > > > While executing a compiled 4ge executable I am getting the following > > > > error. > > > > "Error in loading shared libraries: lib4gsh730.so: cannot open > > shared > > > > object file: No such file or directory." > > > > > > > > I have two servers, the executable works on one but does not work on > > > > the other. I even recompiled on the new server. Compilation gives no > > > > error. But when I try and run it I get the error mentioned above. > > > > > > > > Has anyone seen this error before. > > > > Appreciate any help. > > > > > > > > Thanks > > > > > > > > J > > > > > > > > Sent via Deja.com http://www.deja.com/ > > > > Before you buy. > > > > > > > > > > -- > > > # unrm / > > > ksh: unrm: not found > > > # man cpio > > > > > > Sent via Deja.com http://www.deja.com/ > > > Before you buy. > > > > > > > Sent via Deja.com http://www.deja.com/ > > Before you buy. > Sent via Deja.com http://www.deja.com/ Before you buy.
The install script is supposed to put symbolic links to the libraries in /usr/lib so that the LD_LIBRARY_PATH is not needed. It does not always work or perhaps you copied the installation to the machine that does not work rather than installing clean? Art S. Kagel azteczenith@my-deja.com wrote: > > Exporting LD_LIBRARY_PATH worked. Thanks for all your help guys. I > really appreciate it. This User group has definitely been very helpful > to me. > I do have a question though. I did the install on another identical (at > least I though they were identical) linux server. I did not have to > export this variable. The programs worked fine without my having to > export LD_LIBRARY_PATH. Why did I have to do it in this case. > > Regards > > J > > In article <392C3DBE.E7DE168A@bloomberg.net>, > kagel@bloomberg.net wrote: > > Try exporting LD_LIBRARY_PATH, most systems use that to point to the > shared > > library path. SHLIB_PATH is an old SunOS4 holdover. > > > > Art S. Kagel > > > > azteczenith@my-deja.com wrote: > > > > > > Thanks for your suggestion. I tried setting the SHLIB_PATH > environment > > > variable. That didn't help. The strange thing is that it works fine > on > > > one server. To test the theory that it may be the executable > itself, I > > > created a simple file with the following lines. > > > > > > database xxx > > > main > > > display "HELLO" > > > end main > > > > > > and then compiled it as follows > > > > > > c4gl -o test1.4ge test1.4gl > > > > > > Ran the executable test1.4ge. Received the same exact error. > > > > > > I would greately appreciate any other suggestions you might have. > > > > > > Thanks > > > > > > J > > > > > > In article <8ggvqj$hu1$1@nnrp1.deja.com>, > > > mars1972@my-deja.com wrote: > > > > Did you check your environment? I don't know much about 4gl, but > I've > > > > seen similar problems if SHLIB_PATH is not set correctly. > > > > > > > > In article <8ggvch$hgk$1@nnrp1.deja.com>, > > > > azteczenith@my-deja.com wrote: > > > > > While executing a compiled 4ge executable I am getting the > following > > > > > error. > > > > > "Error in loading shared libraries: lib4gsh730.so: cannot open > > > shared > > > > > object file: No such file or directory." > > > > > > > > > > I have two servers, the executable works on one but does not > work on > > > > > the other. I even recompiled on the new server. Compilation > gives no > > > > > error. But when I try and run it I get the error mentioned > above. > > > > > > > > > > Has anyone seen this error before. > > > > > Appreciate any help. > > > > > > > > > > Thanks > > > > > > > > > > J > > > > > > > > > > Sent via Deja.com http://www.deja.com/ > > > > > Before you buy. > > > > > > > > > > > > > -- > > > > # unrm / > > > > ksh: unrm: not found > > > > # man cpio > > > > > > > > Sent via Deja.com http://www.deja.com/ > > > > Before you buy. > > > > > > > > > > Sent via Deja.com http://www.deja.com/ > > > Before you buy. > > > > Sent via Deja.com http://www.deja.com/ > Before you buy.
I did do an install. I followed exactly the same steps on both servers.
That's why it is confusing. But anyway... setting the PATH worked.
I set it up as
export LD_LIBRARY_PATH=/lib:/usr/lib:$INFORMIXDIR/lib/toolsI presume we do need the unix lib directories as well as the informix
lib directories set up as shown above.
Thanks for your help
J
In article <392D3AFF.28F9787B@bloomberg.net>,
kagel@bloomberg.net wrote:
> The install script is supposed to put symbolic links to the libraries
in
> /usr/lib so that the LD_LIBRARY_PATH is not needed. It does not
always
> work or perhaps you copied the installation to the machine that does
not
> work rather than installing clean?
>
> Art S. Kagel
>
> azteczenith@my-deja.com wrote:
> >
> > Exporting LD_LIBRARY_PATH worked. Thanks for all your help guys. I
> > really appreciate it. This User group has definitely been very
helpful
> > to me.
> > I do have a question though. I did the install on another identical
(at
> > least I though they were identical) linux server. I did not have to
> > export this variable. The programs worked fine without my having to
> > export LD_LIBRARY_PATH. Why did I have to do it in this case.
> >
> > Regards
> >
> > J
> >
> > In article <392C3DBE.E7DE168A@bloomberg.net>,
> > kagel@bloomberg.net wrote:
> > > Try exporting LD_LIBRARY_PATH, most systems use that to point to
the
> > shared
> > > library path. SHLIB_PATH is an old SunOS4 holdover.
> > >
> > > Art S. Kagel
> > >
> > > azteczenith@my-deja.com wrote:
> > > >
> > > > Thanks for your suggestion. I tried setting the SHLIB_PATH
> > environment
> > > > variable. That didn't help. The strange thing is that it works
fine
> > on
> > > > one server. To test the theory that it may be the executable
> > itself, I
> > > > created a simple file with the following lines.
> > > >
> > > > database xxx
> > > > main
> > > > display "HELLO"
> > > > end main
> > > >
> > > > and then compiled it as follows
> > > >
> > > > c4gl -o test1.4ge test1.4gl
> > > >
> > > > Ran the executable test1.4ge. Received the same exact error.
> > > >
> > > > I would greately appreciate any other suggestions you might
have.
> > > >
> > > > Thanks
> > > >
> > > > J
> > > >
> > > > In article <8ggvqj$hu1$1@nnrp1.deja.com>,
> > > > mars1972@my-deja.com wrote:
> > > > > Did you check your environment? I don't know much about 4gl,
but
> > I've
> > > > > seen similar problems if SHLIB_PATH is not set correctly.
> > > > >
> > > > > In article <8ggvch$hgk$1@nnrp1.deja.com>,
> > > > > azteczenith@my-deja.com wrote:
> > > > > > While executing a compiled 4ge executable I am getting the
> > following
> > > > > > error.
> > > > > > "Error in loading shared libraries: lib4gsh730.so: cannot
open
> > > > shared
> > > > > > object file: No such file or directory."
> > > > > >
> > > > > > I have two servers, the executable works on one but does not
> > work on
> > > > > > the other. I even recompiled on the new server. Compilation
> > gives no
> > > > > > error. But when I try and run it I get the error mentioned
> > above.
> > > > > >
> > > > > > Has anyone seen this error before.
> > > > > > Appreciate any help.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > J
> > > > > >
> > > > > > Sent via Deja.com http://www.deja.com/
> > > > > > Before you buy.
> > > > > >
> > > > >
> > > > > --
> > > > > # unrm /
> > > > > ksh: unrm: not found
> > > > > # man cpio
> > > > >
> > > > > Sent via Deja.com http://www.deja.com/
> > > > > Before you buy.
> > > > >
> > > >
> > > > Sent via Deja.com http://www.deja.com/
> > > > Before you buy.
> > >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
azteczenith@my-deja.com wrote:
>
> I did do an install. I followed exactly the same steps on both servers.
> That's why it is confusing. But anyway... setting the PATH worked.
> I set it up as
> export LD_LIBRARY_PATH=/lib:/usr/lib:$INFORMIXDIR/lib/tools> I presume we do need the unix lib directories as well as the informix
> lib directories set up as shown above.
Not usually.
> Thanks for your help
You're welcome.
Art S. Kagel
> J
>
> In article <392D3AFF.28F9787B@bloomberg.net>,
> kagel@bloomberg.net wrote:
> > The install script is supposed to put symbolic links to the libraries
> in
> > /usr/lib so that the LD_LIBRARY_PATH is not needed. It does not
> always
> > work or perhaps you copied the installation to the machine that does
> not
> > work rather than installing clean?
> >
> > Art S. Kagel
> >
> > azteczenith@my-deja.com wrote:
> > >
> > > Exporting LD_LIBRARY_PATH worked. Thanks for all your help guys. I
> > > really appreciate it. This User group has definitely been very
> helpful
> > > to me.
> > > I do have a question though. I did the install on another identical
> (at
> > > least I though they were identical) linux server. I did not have to
> > > export this variable. The programs worked fine without my having to
> > > export LD_LIBRARY_PATH. Why did I have to do it in this case.
> > >
> > > Regards
> > >
> > > J
> > >
> > > In article <392C3DBE.E7DE168A@bloomberg.net>,
> > > kagel@bloomberg.net wrote:
> > > > Try exporting LD_LIBRARY_PATH, most systems use that to point to
> the
> > > shared
> > > > library path. SHLIB_PATH is an old SunOS4 holdover.
> > > >
> > > > Art S. Kagel
> > > >
> > > > azteczenith@my-deja.com wrote:
> > > > >
> > > > > Thanks for your suggestion. I tried setting the SHLIB_PATH
> > > environment
> > > > > variable. That didn't help. The strange thing is that it works
> fine
> > > on
> > > > > one server. To test the theory that it may be the executable
> > > itself, I
> > > > > created a simple file with the following lines.
> > > > >
> > > > > database xxx
> > > > > main
> > > > > display "HELLO"
> > > > > end main
> > > > >
> > > > > and then compiled it as follows
> > > > >
> > > > > c4gl -o test1.4ge test1.4gl
> > > > >
> > > > > Ran the executable test1.4ge. Received the same exact error.
> > > > >
> > > > > I would greately appreciate any other suggestions you might
> have.
> > > > >
> > > > > Thanks
> > > > >
> > > > > J
> > > > >
> > > > > In article <8ggvqj$hu1$1@nnrp1.deja.com>,
> > > > > mars1972@my-deja.com wrote:
> > > > > > Did you check your environment? I don't know much about 4gl,
> but
> > > I've
> > > > > > seen similar problems if SHLIB_PATH is not set correctly.
> > > > > >
> > > > > > In article <8ggvch$hgk$1@nnrp1.deja.com>,
> > > > > > azteczenith@my-deja.com wrote:
> > > > > > > While executing a compiled 4ge executable I am getting the
> > > following
> > > > > > > error.
> > > > > > > "Error in loading shared libraries: lib4gsh730.so: cannot
> open
> > > > > shared
> > > > > > > object file: No such file or directory."
> > > > > > >
> > > > > > > I have two servers, the executable works on one but does not
> > > work on
> > > > > > > the other. I even recompiled on the new server. Compilation
> > > gives no
> > > > > > > error. But when I try and run it I get the error mentioned
> > > above.
> > > > > > >
> > > > > > > Has anyone seen this error before.
> > > > > > > Appreciate any help.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > J
> > > > > > >
> > > > > > > Sent via Deja.com http://www.deja.com/
> > > > > > > Before you buy.
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > # unrm /
> > > > > > ksh: unrm: not found
> > > > > > # man cpio
> > > > > >
> > > > > > Sent via Deja.com http://www.deja.com/
> > > > > > Before you buy.
> > > > > >
> > > > >
> > > > > Sent via Deja.com http://www.deja.com/
> > > > > Before you buy.
> > > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
"Art S. Kagel" wrote:
> azteczenith@my-deja.com wrote:
> > I did do an install. I followed exactly the same steps on both servers.
> > That's why it is confusing. But anyway... setting the PATH worked.
> > I set it up as
> > export LD_LIBRARY_PATH=/lib:/usr/lib:$INFORMIXDIR/lib/tools> > I presume we do need the unix lib directories as well as the informix
> > lib directories set up as shown above.
>
> Not usually.
As Art says, you do not have to put /lib and /usr/lib on
LD_LIBRARY_PATH because they are searched when the dynamic
loader has run out of other places to look.
On at least some of my systems, /lib is a symlink to /usr/lib,
so I don't usually put both on LD_LIBRARY_PATH.
However, I do usually put /usr/lib on LD_LIBRARY_PATH ahead of
everything else. I do it because that way, programs (such as the
shell, and ls) find the system libraries with fewer failed efforts
poking around the Informix library directories. I've not measured
the performance difference, but if you end up with $INFORMIXDIR/lib
and $INFORMIXDIR/lib/esql and $INFORMIXDIR/lib/tools and any of the
CLI or C++ or ... Informix directories, not to mention /usr/local/lib
and /usr/gnu/lib and ... on the path, then it does take quite a few
operations to find libc.so -- try running truss on a program to see
what I mean.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN
#include <disclaimer.h>