Dynamic libraries
This is mostly about using .so files on linux. Building them and windows may be added later.
linux
On linux, the program ldconfig is key. You can always force a dynamic library to be found with the LD_LIBRARY_PATH environment variable. :
LD_LIBRARY_PATH
| LD_LIBRARY_PATH | |
|---|---|
Or.. if it already contains a value :
| add path | |
|---|---|
If you no run your program it will look in /newdir immediately for .so files. However we probably want a more permanent way of setting this variable.
/usr/local/lib
The GNU standards recommend installing by default all libraries in /usr/local/lib. The effect of that would be that you don't have to alter the ld path because it will be searched automatically.
You can view what the system sees as it's dynamic cache with
| cache | |
|---|---|
A snippet of this command shows it scans /usr/local/lib :
| snippet | |
|---|---|
So mongodb makes use of that location.
/etc/ld.so.conf.d
Maybe you want the .so file to be in you own installation dir, or maybe you just want to put the development directory to be scanned while developing code. You could add an extra entry (file) in /etc/ld.so.conf.d/ containing :
| /etc/ld.so.conf.d/* | |
|---|---|
Watch that this file has to end in .conf since the script that includes all these scripts is :
| /etc/ld.so.conf | |
|---|---|
Now still nothing happens until you run ldconfig, after that ldconfig -v will show :