Linking not working in homebrew's cmake since Mojave

后端 未结 2 1335
故里飘歌
故里飘歌 2020-12-06 05:34

I\'ve reproduced this symptom on two computers now, cmake seems to no longer look in /usr/local/lib (or more properly, $(brew --prefix)/lib

2条回答
  •  执笔经年
    2020-12-06 05:55

    Ran into a related (?) issue while trying to pip install psycopg2 in a Django app under OS X Mojave (10.14). I was getting the following errors:

    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'clang' failed with exit status 1
    

    The short explanation: « As of High Sierra, /usr/local is no longer chown-able... »

    The solution: change permissions for /usr/local to allow Homebrew to create links.

    I adapted the solution to my needs. Then I was finally able to run pip install psycopg2. Here is the sequence of commands (update: inside your project root i.e. where you see manage.py).

    First

    sudo chown -R $(whoami) $(brew --prefix)/*
    

    Then

    brew reinstall openssl
    export LDFLAGS="-L/usr/local/opt/openssl/lib"
    export CPPFLAGS="-I/usr/local/opt/openssl/include"
    pip install psycopg2
    

提交回复
热议问题