Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a shared object file libfault.so for my 32 bit compiled application on RHEL 6.4. I want to preload this file while starting my application. I have placed it in /usr/local/lib/ directory.

But while starting the application, i am getting the following error.

ERROR: ld.so: object 'libfault.so' from LD_PRELOAD cannot be preloaded: ignored.

But, if i compile libfault.so in 64 bit and place in /usr/local/lib64/, I do not get the error. But the file is not doing its intended function since my application is 32 bit compiled.

share|improve this question
add comment

1 Answer 1

You can use the environment variable $LD_LIBRARY_PATH to override the dynamic loader's search path when looking for libraries to load.

To do it temporarily for a single application, you can invoke it like so:

$ LD_LIBRARY_PATH=/usr/local/lib <your executable here>

You can make the change more permanent for your shell instance by exporting that variable:

$ export LD_LIBRARY_PATH=/usr/local/lib

Adjust the paths above as needed for where ever your 32-bit .so is being stored.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.