---- Original Message ----
> From Ilan Nehama <[EMAIL PROTECTED]>
> Date: Wednesday, 13 Aug 2003, 09:42
>
> I am using xerces 2.2 on both AIX and Linux.
> I compile the library xerces and then change its name and move it to
> another directory.
> That way I have in one directory the two libraries.
>
> In Linux , when using gcc, the compilation+linkage succeeds, but on run
> time the old library name is searched.
> I know that in the compilation the new name is search because I tried
> changing the name and got linkage error.
Are you sure that when running the application it's searching for the
old name, and not just failing to look in the right directory?
Run 'ldd' on the binary (executable) you're trying to run and it should
list the libraries it's trying to use: for example if I was having
problems running our 'xgrep' program I might try the following
[EMAIL PROTECTED] xgrep]$ ldd ./xgrep
libxerces-c.so.23 => /home/local/swhite/xml-xerces/c/lib/libxerces-c.so.23
(0x40014000)
libdl.so.2 => /lib/libdl.so.2 (0x40402000)
libpathan.so.2 => /home/local/swhite/extcvs/Pathan/lib/libpathan.so.2
(0x40405000)
libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x404a0000)
...
If it doesn't find a library you'll get something like:
[EMAIL PROTECTED] xgrep]$ ldd ./xgrep
libxerces-c.so.23 => not found
libdl.so.2 => /lib/libdl.so.2 (0x40028000)
libpathan.so.2 => /usr/lib/libpathan.so.2 (0x4002b000)
libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x400c4000)
...
In this case (and assuming that the name of the library it's looking for
is what you expected) then make sure that the library is in a directory
that is being searched (unlike on Windows, most unix systems do by not
search the current directory or the directory containing the exectuable
- though I'm not sure what AIX does). On most Linux systems the
directories being searched are listed in /etc/ld.so.conf, and can be
added to or overridden by setting the 'LD_LIBRARY_PATH' environment
variable, eg
export
LD_LIBRARY_PATH=/home/local/swhite/xml-xerces/c/lib/:/home/local/swhite/extcvs/Pathan/lib
--
Stephen White +44-1865-203192
DecisionSoft Limited http://www.decisionsoft.com
XML Development and Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]