Hi,
'dlopen' ignores the search path that is defined for LD_LIBRARY_PATH on macOS 12.2 and 12.3, even-though the path doesn't contain slash.
LD_LIBRARY_PATH is set as follows (before the call): export LD_LIBRARY_PATH="/Users/administrator/Desktop/Test/"
'test_library.dylib' is located under '/Users/administrator/Desktop/Test/'
The c call at the application looks as follows (The application is built by Xcode 13): handle = dlopen("test_library.dylib", RTLD_LAZY);
I see that the error i get, when calling to dlopen, is that test_library.dylib isn't found. From the error it looks that library loader doesn't search the library at the search path that is defined for LD_LIBRARY_PATH. During the call, the LD_LIBRARY_PATH contains the path.
If i set this path to DYLD_LIBRARY_PATH, dlopen finds 'test_library.dylib' and everything works as expected.
I didn't find any documentation for this issue, therefore, is it a known limitation? Is there a workaround?
Thx, Moshe.