ton icon indicating copy to clipboard operation
ton copied to clipboard

Cannot link directly with dylib/framework

Open PashaKlybik opened this issue 6 years ago • 7 comments

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

PashaKlybik avatar Oct 10 '19 13:10 PashaKlybik

Duplicate of #108

ton-blockchain avatar Oct 10 '19 14:10 ton-blockchain

xcode-select --install should help

ton-blockchain avatar Oct 10 '19 14:10 ton-blockchain

@ton-blockchain xcode-select already installed((

xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

PashaKlybik avatar Oct 10 '19 14:10 PashaKlybik

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"

3wnbr1 avatar Nov 03 '19 17:11 3wnbr1

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

Lagroxane avatar Mar 26 '20 14:03 Lagroxane

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

gr8den avatar Apr 06 '20 05:04 gr8den

Before building, run export OPENSSL_ROOT_DIR=/usr/local/opt/openssl

innerNULL avatar Sep 23 '20 10:09 innerNULL