Errors running v0.33.0, dyld: Library not loaded: /opt/crystal…

Hi bcardiff,

I’ve got pkg-config too, I’m just lazy with typing so favour pkgconf slightly, sorry :slight_smile:

For some unknown reason the .pc file was yaml-0.1.pc even though the version is 0.2.2. I don’t understand that naming convention.

Anyway, I’ve symlinked it to yaml.pc, now I get:

$ cat /opt/pkg/lib/pkgconfig/yaml.pc
prefix=/opt/pkg
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib

Name: LibYAML
Description: Library to parse and emit YAML
Version: 0.2.2
Cflags: -I${includedir}
Libs: -L${libdir} -lyaml


$ pkg-config yaml --libs
-L/opt/pkg/lib -lyaml 


$ l /opt/pkg/lib | ag yaml
-rw-r--r--    1 root  9.5M Feb 14 11:25 libLLVMObjectYAML.a
-rwxr-xr-x    1 root  212K Jan 28 03:03 libyaml-0.2.dylib
-rw-r--r--    1 root  239K Jan 28 03:03 libyaml.a
lrwxr-xr-x    1 root    17 Jan 28 03:03 libyaml.dylib -> libyaml-0.2.dylib
-rwxr-xr-x    1 root   950 Jan 28 03:03 libyaml.la

Should I perhaps symlink these as yaml.xx etc?

$ shards 
dyld: Library not loaded: /opt/crystal/embedded/lib/libyaml-0.2.dylib
  Referenced from: /Users/iainb/Library/Frameworks/Crystal.framework/Versions/Current/embedded/bin/shards
  Reason: image not found
[1]    17054 abort      shards

Crystal itself seems fine though, it’s just stuff in the embedded dir that fails. For instance, I tried it out on a simple program:

$ crystal run 02-Counting-the-number-of-characters.cr 
What is the input string?
testing
testing has 7 characters

If anything comes to mind, just let me know, and thanks for taking time on this, much appreciated.

Regards,
iain