What is /usr/local/lib on macos?
Olivia Zamora
Libgtksourceview-2.0.0.dylib requires version 6001.0.0 or later, but libgio-2.0.0.dylib provides version 5503.0.0
However, I do not know how to raise the libgio-2.0.0.dylib version.
What kind of directory is /usr/local/lib in the first place?
please tell me.
3 Answers
All of /usr/local is for stuff you (or your system administrator) installed, that did not come with the OS from Apple. /usr/local/lib is for libraries: packages of precompiled code implementing various useful functions, that can be loaded and used by apps, but are not themselves apps.
If you don't recall installing these libraries, they were probably installed by an open source software package management system such as Homebrew. Look into using brew to upgrade them.
From the Apple File System Programming Guide
/usr- Contains non-essential command-line binaries, libraries, header files, and other data.
More specifically, /usr/lib is for macOS installed shared libraries. Anything under /usr/local are user-installed. So /usr/local/lib contains shared libraries installed by you.
More likely that not, belongs to the libgtksourceview-2.0.0.dylib gtksourceview installed by Homebrew and libgio-2.0.0.dylib belongs to glib. The error message shows gtksourceview is compiled with a newer version of glib that is available on your system.
There are a couple of solutions, assuming you have Homebrew installed.
Reinstall gtksourceview and glib
Reinstall both software
brew reinstall glib gtksourceviewReinstall or upgrade gtksourceview
Either
brew upgrade --build-from-source gtksourceviewor
brew reinstall --build-from-source gtksourceviewIf the glib dependency is out of data, it will be upgraded too. The --build-from-source option will ensure gtksourceview is compiled from scratch, linking with the available glib version in your system.
For installing a package, you need to compile that package with existing compilers(depends on what language developers used for that package). There are gonna be libraries that compiler needs for installing that package. This is linker's job to link those libraries.
/usr/local/lib is one the directories that linker searches for required libraries. There are configuration files along with the installation package which search for necessary libraries.