ld.so.conf and .profile

Hi

I'm sorry I'm new here forum FreeBSD and if I do something wrong then sorry

I have a similar problem in Ubuntu I use of such entry for files /etc/ld.so.conf
Code:
/home/user/<my library>/build/out
and for files .profile
Code:
export MY_LIB="$HOME/<my library>"
How to do it FreeBSD ?

Please help
 
Last edited by a moderator:
As far as I know the MY_LIB variable is not used by the FreeBSD dynamic linker. The LD_LIBRARY_PATH variable on the other is probably what you want to use. From rtld(1):

Code:
The
     following search order is used to locate required shared objects:

           1.   DT_RPATH of the referencing object unless that object also
                contains a DT_RUNPATH tag
           2.   DT_RPATH of the program unless the referencing object contains
                a DT_RUNPATH tag
           3.   Path indicated by LD_LIBRARY_PATH environment variable
           4.   DT_RUNPATH of the referencing object
           5.   Hints file produced by the ldconfig(8) utility
           6.   The /lib and /usr/lib directories, unless the referencing
                object was linked using the “-z nodefaultlib” option
 
Probably the best way to test it is to launch your application like this:
env LD_LIBRARY_PATH=${HOME}/mylibs:${LD_LIBRARY_PATH} /path/to/myapp

This should work regardless of the shell you're using.
 
I not solved the problem,

I use the Windows so

set MY_LIB=c:\mylibs

set PATH=C:\mylibs\build\out

how to do it FreeBSD
can anyone help ?
 
Back
Top