0

我检查并安装了 libevent,安装了 GCC。LLVM 已更新。运行 Crystal Play 工作,然后崩溃并出现以下错误。我可以看到本地主机输出。但它会尝试运行代码然后它会崩溃。

    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.2.0

  CPUs-MacBook-Air:~ cpu$ crystal play
Listening on http://localhost:8080
ld: library not found for -levent
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/cpu/Documents/homebrew/.crystal/crystal-run-play-1-1.tmp" "${@}"  -rdynamic  -lssl -lcrypto -lz /usr/local/Cellar/crystal-lang/0.14.2/src/ext/libcrystal.a -levent -lpcre -liconv -lgc -lpthread -ldl`
4

1 回答 1

3

查看 OSX 安装页面:http ://crystal-lang.org/docs/installation/on_mac_osx_using_homebrew.html

您可能必须执行这些操作才能让 xcode 找到 libevent:

$ xcode-select --install
$ xcode-select --switch /Library/Developer/CommandLineTools
于 2016-03-29T12:59:25.003 回答