ton
ton copied to clipboard
Cannot link directly with dylib/framework
I make macos 10.15 (Catalina) openssl version : OpenSSL 1.1.1d 10 Sep 2019
cmake ../ton/
cmake --build . --target lite-client
and i have this problem
[ 90%] Building CXX object tl/generate/CMakeFiles/generate_common.dir/tl_writer_hpp.cpp.o
[ 90%] Building CXX object tl/generate/CMakeFiles/generate_common.dir/tl_writer_td.cpp.o
[ 90%] Building CXX object tl/generate/CMakeFiles/generate_common.dir/tl_writer_jni_cpp.cpp.o
[ 90%] Building CXX object tl/generate/CMakeFiles/generate_common.dir/tl_writer_jni_h.cpp.o
[ 90%] Linking CXX executable generate_common
ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [tl/generate/generate_common] Error 1
make[2]: *** [tl/generate/CMakeFiles/generate_common.dir/all] Error 2
make[1]: *** [lite-client/CMakeFiles/lite-client.dir/rule] Error 2
make: *** [lite-client] Error 2
Duplicate of #108
xcode-select --install should help
@ton-blockchain xcode-select already installed((
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
I encountered the same problem with a different project. ld was failling to link with libcrypto.dylib with xcode-select already setup. It seems to be a PATH issue and appending /Library/Apple/usr/bin:/Library/Apple/bin at the end of my PATH fixed this.
- fish :
set -gx PATH "$PATH:/Library/Apple/usr/bin:/Library/Apple/bin" - bash :
export PATH="$PATH:/Library/Apple/usr/bin:/Library/Apple/bin"
Hi. I had this problem trying to build code lite. Then I found this video and it fixed the problem. It is worth the 15 minutes watch. https://www.youtube.com/watch?v=1a-cPJ4jGGI&t=609s
Hope it helps c
I fix build errors after upgrade to Catalina
xcode-select --install
brew update && brew upgrade
In ton-build folder:
cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/[email protected]" -DOPENSSL_LIBRARIES="/usr/local/opt/[email protected]/lib" ../ton
Then replace /usr/local/opt/openssl/include to /usr/local/opt/[email protected]/include in all files in ton-build folder
make
Before building, run export OPENSSL_ROOT_DIR=/usr/local/opt/openssl