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

icr on Mac Mojave #110

Closed
Brandongoodman615 opened this issue Aug 23, 2019 · 10 comments
Closed

icr on Mac Mojave #110

Brandongoodman615 opened this issue Aug 23, 2019 · 10 comments

Comments

@Brandongoodman615
Copy link

When trying to build or install I get errors, package is installed and reinstalled.

Error target icr failed to compile:
ld: library not found for -lssl (this usually means you need to install the development package for libssl)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/brandongoodman/Desktop/crystal/firstapp/icr/bin/icr'  -rdynamic  -lreadline -lyaml -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lpcre /usr/local/Cellar/crystal/0.30.1/embedded/lib/libgc.a -lpthread /usr/local/Cellar/crystal/0.30.1/src/ext/libcrystal.a -levent -liconv -ldl -L/usr/local/Cellar/crystal/0.30.1/embedded/lib -L/usr/lib -L/usr/local/lib`
@jwoertink
Copy link
Collaborator

Do you have this set?

export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig

@Brandongoodman615
Copy link
Author

Brandongoodman615 commented Aug 23, 2019 via email

@Brandongoodman615
Copy link
Author

Brandongoodman615 commented Aug 23, 2019 via email

@jwoertink
Copy link
Collaborator

Ah. Well then welcome! This env var is a little strange. It's more of a crystal thing than it is a ICR thing. Check this out.

Just open up your ~/.bash_profile, and add this to the bottom.

export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig

Then restart your terminal, and 🤞 hope that works. If not, then we can try something else.

@Brandongoodman615
Copy link
Author

Brandongoodman615 commented Aug 23, 2019 via email

@jwoertink
Copy link
Collaborator

It's all good. If you get stuck, come hop in the chat https://gitter.im/crystal-lang/crystal someone can help walk you through it. Then if there is an actual bug, we can get a good idea on what it is and how to fix it.

@atatarenko
Copy link

I'm getting the same error even with PKG_CONFIG_PATH set. This is what I basically see

➜  icr git:(master) sudo make install                                          
/usr/local/bin/shards build --release 
Dependencies are satisfied
Building: icr
Error target icr failed to compile:
ld: library not found for -lssl (this usually means you need to install the development package for libssl)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/andrey/projects/icr/bin/icr'  -rdynamic  -lreadline -lyaml -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lpcre /usr/local/Cellar/crystal/0.31.1/embedded/lib/libgc.a -lpthread /usr/local/Cellar/crystal/0.31.1/src/ext/libcrystal.a -levent -liconv -ldl -L/usr/local/Cellar/crystal/0.31.1/embedded/lib -L/usr/lib -L/usr/local/lib`

make: *** [build] Error 1

Some other outputs that might be useful

➜  icr git:(master) echo $PKG_CONFIG_PATH                                                      
/usr/local/opt/openssl/lib/pkgconfig
➜  icr git:(master) command -v pkg-config > /dev/null && pkg-config --libs libssl                                               
-L/usr/local/Cellar/openssl/1.0.2t/lib -lssl
➜  icr git:(master) command -v pkg-config > /dev/null && pkg-config --libs libcrypto                            
-L/usr/local/Cellar/openssl/1.0.2t/lib -lcrypto

So it seems like the right linking but it still doesn't work. I've already tried reinstalling the crystal compiler and running it one more time.

@atatarenko
Copy link

I'm running into this issue on macOS Mojave 10.14.16 btw

@veelenga
Copy link
Member

veelenga commented Nov 3, 2019

This is related to crystal-lang/crystal#6875

@Sija
Copy link
Contributor

Sija commented Feb 8, 2020

Can be closed it seems.

@veelenga veelenga closed this as completed Feb 8, 2020
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

5 participants