The linker is looking for .so
files in the system library paths and user defined paths (like /home/ubuntu/Documents/3rdparty/lib/
). These .so
files are defined by -l
argument. For example the -latlas
corresponds to libatlas.so
.
If libatlas.so
file is not found then the linker will look for libatlas.a
. This file is basically an ar
(archive) file of all .o
library files. The .a
files are treated same as objects and are included inside the executable. So they do not appear in ldd
command.
If you use -static
argument with g++
then you force the linker to look only for .a
files and then ldd
returns nothing.
In order to make dynamic link to libatlas.so
you need to add this file in /home/ubuntu/Documents/3rdparty/lib/
.