Closed briteming closed 4 years ago
能提供下你的系统版本吗?
系统版本是10.12.6
尝试通过 brew 安装 openssl 了吗?
yudeMacBook-Air:~ brite$ brew install openssl
Updating Homebrew...
Warning: openssl@1.1 1.1.1g is already installed and up-to-date
To reinstall 1.1.1g, run brew reinstall openssl@1.1
yudeMacBook-Air:~ brite$ brew install openssl@1.0
Error: No available formula with the name "openssl@1.0"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found. ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Warning: Error searching on GitHub: curl failed! % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to api.github.com port 443: Connection refused
Error: No formulae found in taps. yudeMacBook-Air:~ brite$
安装过openssl
那么这个动态库在你系统里面存在吗?
/usr/local/opt/openssl/lib/libssl.1.0.0.dylib
存在的。 yudeMacBook-Air:~ brite$ ls /usr/local/opt/openssl/lib/ engines-1.1 libcrypto.dylib libssl.dylib libcrypto.1.0.0.dylib libssl.1.0.0.dylib pkgconfig libcrypto.1.1.dylib libssl.1.1.dylib libcrypto.a libssl.a yudeMacBook-Air:~ brite$
那你尝试下用环境变量 DYLD_LIBRARY_PATH
试下。
我重装了openssl: brew install openssl ls /usr/local/opt/openssl/lib/ 显示: engines-1.1 libcrypto.a libssl.1.1.dylib libssl.dylib libcrypto.1.1.dylib libcrypto.dylib libssl.a pkgconfig
我运行: sudo ./vpn_macos_oldest --server-addr vps-ip:56367 --disable-crypto Password: 显示: dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /Users/brite/./vpn_macos_oldest Reason: image not found Abort trap: 6
如何让程序vpn_macos_oldest去加载/usr/local/opt/openssl/lib/libssl.1.1.dylib而非加载 /usr/local/opt/openssl/lib/libssl.1.0.0.dylib?
我运行了: export DYLD_LIBRARY_PATH=/usr/local/opt/openssl/lib echo 'export DYLD_LIBRARY_PATH=/usr/local/opt/openssl/lib' >> ~/.profile 然后运行 sudo ./vpn_macos_oldest --server-addr vps-ip:56367 --disable-crypto 依旧出现上面的错误提示
手动复制一下试试看。
cd /usr/local/Cellar/openssl@1.1/1.1.1d/lib;
cp libssl.1.1.dylib libssl.1.0.0.dylib
cp libcrypto.1.1.dylib libcrypto.1.0.0.dylib
我是复制/usr/local/opt/openssl/lib/里面的东西: cd /usr/local/opt/openssl/lib cp libssl.1.1.dylib libssl.1.0.0.dylib cp libcrypto.1.1.dylib libcrypto.1.0.0.dylib
然后运行 sudo ~/vpn_macos_oldest --server-addr vps-ip:56367 --disable-crypto 这次正常了。
运行: /usr/local/Cellar/openssl@1.1/1.1.1g/bin/openssl version 显示: OpenSSL 1.1.1g 21 Apr 2020
运行 /usr/local/opt/openssl/bin/openssl version 也显示: OpenSSL 1.1.1g 21 Apr 2020
/usr/local/Cellar/openssl@1.1/1.1.1g和/usr/local/opt/openssl/的目录内容是一样的,因此/usr/local/opt/openssl/是/usr/local/Cellar/openssl@1.1/1.1.1g/的硬链接吗?
应该是软链接吧。
hi.
yudeMacBook-Air:~ brite$ sudo ./vpn_macos_oldest --server-addr vps-ip:56367 --disable-crypto 显示: dyld: Library not loaded: @executable_path/../Frameworks/libcrypto.1.0.0.dylib Referenced from: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Reason: image not found Abort trap: 6 yudeMacBook-Air:~ brite$
怎么解决?