I\'m trying to build a project that depends on SDL2 library. I\'ve installed and linked it using homebrew:
> ls /usr/local/lib | grep SDL2
libSDL2-2.0.0.d
/etc/paths
is for executable files, not shared libraries. Same with the $PATH
environmental variable set in .bash_profile
. These are the paths searched for programs when you type a command in the terminal.
What you need to do is change the linkers link path. See the answer to this question for details on how to set up the link path.
I fixed the issue by adding /usr/local/lib
to my $LIBRARY_PATH
:
For bash, in ~/.bash_profile
:
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib"
And for fish shell, in ~/.config/fish/config.fish
:
set -g -x LIBRARY_PATH $LIBRARY_PATH /usr/local/lib