Does it point to a problem with the compiler or to a missing library ?
NB: The same operation works correctly when omitting the ‘static’ option
Alternatively : How do I distribute an app written in Crystal, if it is not statically compiled ?
otool -L ./bin/hello
yields:
./bin/hello:
/opt/homebrew/opt/bdw-gc/lib/libgc.1.dylib (compatibility version 7.0.0, current version 7.1.0)
/opt/homebrew/opt/libevent/lib/libevent-2.1.7.dylib (compatibility version 8.0.0, current version 8.1.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
The problem seems to be related to:
crystal build ./src/hello.cr --static --release --progress
ld: library not found for -lcrt0.o **(this usually means you need to install the development package for libcrt0.o)**
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/sergehulne/Documents/code/Crystal/0_hello/hello/hello -rdynamic -static -L/opt/homebrew/Cellar/crystal/1.7.2/libexec/../../../../lib -lgc -L/opt/homebrew/Cellar/libevent/2.1.12/lib -levent -liconv`**