Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS Linker Problem #87

Closed
DinosL opened this issue Oct 21, 2019 · 7 comments
Closed

MacOS Linker Problem #87

DinosL opened this issue Oct 21, 2019 · 7 comments

Comments

@DinosL
Copy link

DinosL commented Oct 21, 2019

Hello,

make command fails with the following error

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[2]: *** [libs2.dylib] Error 1 make[1]: *** [CMakeFiles/s2.dir/all] Error 2 make: *** [all] Error 2

That is not the first time i encounter this error after upgrading and I suppose it is a Catalina error. I have already tried xcode-select --install but it is not working.

Any suggestions?

Thank you in advance

@jmr
Copy link
Member

jmr commented Oct 30, 2019

I don't think I'll be upgrading to Catalina for a long time. Can you install openssl / libcrypto with MacPorts or homebrew and use that one?

@DinosL
Copy link
Author

DinosL commented Oct 30, 2019

I already had openssl installed so I run brew upgrade openssl. This took some minutes because it upgraded all the dependencies to be compatible with Catalina. Now it works fine.

I have encountered so many problems with libraries and 32-bit apps and I can agree that you should not upgrade yet.

Have a nice day

@DinosL DinosL closed this as completed Oct 30, 2019
@jmr
Copy link
Member

jmr commented Oct 30, 2019

We should at least update the code to explain the Catalina workaround.

@jmr jmr reopened this Oct 30, 2019
@DinosL
Copy link
Author

DinosL commented Oct 30, 2019

I am not sure I understand what you mean. I did not make any changes to the code. I just upgraded openssl using the above command and then re-installed s2 using your build instructions. Now I can run the same code I was running on Linux on macOS.

@jmr
Copy link
Member

jmr commented Oct 30, 2019

If it works with brew upgrade, then it's ok. I thought there might be extra, special steps for Cataline.

@CloudNiner
Copy link

It appears that this issue might be back. Brew removed openssl 1.0 in brew 2.2.0, see aisingapore/TagUI#635 which links to the brew changelog.

I attempt to run the following:

mdkir build
cd build
cmake -DOPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl@1.1/1.1.1d/include/ ..
make s2

and get:

[100%] Linking CXX shared library libs2.dylib
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]: *** [libs2.dylib] Error 1
make[2]: *** [CMakeFiles/s2.dir/all] Error 2
make[1]: *** [CMakeFiles/s2.dir/rule] Error 2
make: *** [s2] Error 2

on MacOS Catalina, brew 2.2.10, openssl@1.1: 1.1.1d. As above, xcode tools were already installed with xcode-select --install

@lpicanco
Copy link

lpicanco commented Jul 1, 2020

It worked for me using these steps:

sudo ln -s /usr/local/Cellar/openssl@1.1/1.1.1g/lib/libcrypto.1.1.dylib /usr/local/lib/libcrypto.dylib
sudo ln -s /usr/local/Cellar/openssl@1.1/1.1.1g/lib/libssl.1.1.dylib /usr/local/lib/libssl.dylib
cmake [normal arguments] -DOPENSSL_CRYPTO_LIBRARY="/usr/local/lib/libcrypto.dylib" -DOPENSSL_SSL_LIBRARY=/usr/local/lib/libssl.dylib

macOS Catalina
Homebrew 2.4.2
openssl@1.1/1.1.1g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants