[fpc-pascal] Where is fpc finding link directories?

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Dec 11 16:02:18 CET 2015

Anthony Walter wrote on Fri, 11 Dec 2015:

> I am having a problem with fpc picking up linking directories on my
> Raspberry Pi.

It's unrelated to FPC. The same will happen with GCC or Clang.

> I have a this lib:
> /opt/vc/lib/libGLESv2.so
> When I execute "ldconfig -v" it shows both "/opt/vc/lib/" as a ld link
> directory, and the file libGLESv2.so as a linkable library.

ldconfig shows the paths where the dynamic linker looks for libraries.  
The dynamic linker is invoked when a program starts, to look for the  
libraries on which the program depends as encoded by the static linker.

The static linker does not use the dynamic linker's configuration,  
because it's a completely different and unrelated program with a  
different purpose. In particular, you generally do not want it to  
automatically pick up library overrides that may be specific to your  
system or even current run.

E.g., when running the static linker under Valgrind, you don't want it  
to automatically link in the valgrind library in the target program,  
even though the dynamic linker has been configured to inject it in  
every process, nor do you want it to find the Valgrind libraries even  
though they are in the dynamic linker's search path during the current  

A very important property of builds is that they are predictable and  
should depend as little as possible on the run time environment. As a  
result, you always have to explicitly specify any non-standard search  


More information about the fpc-pascal mailing list