ld: library not found

后端 未结 2 1309
星月不相逢
星月不相逢 2021-01-05 13:28

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         


        
2条回答
  •  天命终不由人
    2021-01-05 13:59

    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
    

提交回复
热议问题