crystal-lang 学习二 macos openssl 问题
因为我的openssl 是使用brew 安装的,按照一般的解决方法是如下配置
注意我的是按照brew 安装的版本的提示
配置
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
但是依然还是提示
Error: execution of command failed with code: 1: `cc "${@}" -o /Users/dalong/.cache/crystal/crystal-run-main.tmp -rdynamic -L/usr/local/Cellar/crystal/0.35.1/embedded/lib -L/usr/lib -L/usr/local/lib -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 -lgc -lpthread /usr/local/Cellar/crystal/0.35.1/src/ext/libcrystal.a -L/usr/local/Cellar/libevent/2.1.11_1/lib -levent -liconv -ldl
解决方法
运行时指定连接的lib
参考命令
crystal build src/main.cr --link-flags -L/usr/local/opt/openssl@1.1/lib
shards build 说明
同样也是添加链接
shards build --link-flags -L/usr/local/opt/openssl@1.1/lib
参考资料
https://gitter.im/crystal-lang/crystal?at=5d8df36feb1eff63d63302d4
https://www.crstin.com/crystal-openssl/
https://github.com/crystal-lang/crystal/issues/6875
https://github.com/rongfengliang/crystal-shards-macos-learning
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2019-07-02 nexus 3.17.0 简单试用
2019-07-02 nexus 3.17.0 简单说明
2019-07-02 Building a Service Mesh with HAProxy and Consul
2019-07-02 Using HAProxy as an API Gateway, Part 3 [Health Checks]
2019-07-02 Using HAProxy as an API Gateway, Part 2 [Authentication]
2019-07-02 Using HAProxy as an API Gateway, Part 1 [Introduction]
2019-07-02 cjss 像编写css 一样开发web应用