From: Fred P. Jr. <fp...@us...> - 2003-10-27 05:57:17
|
Brad Pepers wrote: > Thanks! Its a real show stopper at least for me and I assume it will bite > other people when they link with libstdc++ in the wrong order or try to > dynamically load the library. > Hi Brad, Good news -- there is a workaround. You're lucky because you're running on a platform that uses an ld.so style dynamic linker! Until this is resolved, try using something like the following command to execute your FB applications: env LD_PRELOAD=/usr/local/firebird/lib/libfbembed.so fb_test The LD_PRELOAD variable tells the dynamic linker to preload the specified library/libraries before any others. The "env" command above will set the environment variable as specified and then run your application which will inherit the new setting. For you this means your app. should run correctly regardless of the library order used to link it. However, do not set LD_PRELOAD to this value in the environment of any non-FB C++ programs. For example, don't set this in your .cshrc, .profile or .bashrc files. Forcing other programs to use the FB delete operators, when they expect to use the -lstdc++ delete operators, could result in... unpleasant happenings. ;-) You should be okay if you use the "env" program as shown above AND your application doesn't spawn any child processes that run non-FB C++ programs. Hope this helps, ---Fred P. P.S. Here's an excerpt from the RH8 man page for ld.so, if you need a little more info on this env. variable: LD_PRELOAD A whitespace-separated list of additional, user-specified, ELF shared libraries to be loaded before all others. This can be used to selectively override functions in other shared libraries. For setuid/setgid ELF binaries, only libraries in the standard search directories that are also setuid will be loaded. |