How are applications supposed to find libraries in /opt/local/lib and /opt/homebrew/lib ? #1600
-
People are using applications like ruby installed into their home directory, which make use of libraries installed by homebrew. Since homebrew doesn't install libraries into some system default library search path, but into As a workaround Ruby-FFI implements a hardcoded list of search paths, which is used as a fallback, if otherwise library loading would fail. This list was extended to the above two directories in https://github.com/ffi/ffi/pull/882/files to enable loading of homebrew libraries. Is there a better way to locate homebrew libraries other than hardcoding filesystem paths into depending applications/libraries? Why are there no system library load mechanisms to make sure the homebrew libraries are found? On Linux there's Is the assumption correct at all, that homebrew libraries are expected to work when used by non-homebrew applications? How do homebrew's own applications find depending libraries? Something like I'm sorry, my knowledge about homebrew and MacOS is very limited. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
This is build-system dependent, unfortunately. Usually, setting |
Beta Was this translation helpful? Give feedback.
This is build-system dependent, unfortunately. Usually, setting
LDFLAGS=-L/opt/homebrew/lib
should work (as long as the library you're looking for is not from a keg-only formula).