Why does dyld look for dynamic libraries in the process's current working directory at runtime?

36 Views Asked by At

Say when compiling my executable, I link it with a custom library. gcc -c main.c -lcustom -o exec

Then when I go to run my executable, if my process's current working directory contains libcustom.dylib, then execution will work, otherwise it won't. When I read the man pages for dyld, it seems like it does not consider the current working directory of the process to be a runtime path.

0

There are 0 best solutions below