Hi, I have just installed Crystal and am trying to use BigDecimal, and getting an error. Some details follow.
- macOS Monterey 12.6, Apple M1
- Crystal 1.7.0 installed with Homebrew
- gmp 6.2.1_1 installed with Homebrew
Running the following:
$ crystal i
icr> require "big/big_decimal"
Getting error:
undefined reference to `__gmp_set_memory_functions' (Crystal::Loader::LoadError)
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'raise<Crystal::Loader::LoadError>:NoReturn'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::Repl::Context#c_function<String>:Pointer(Void)'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::Repl::Compiler#visit<Crystal::Call>:Bool'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Repl::Compiler>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Repl::Compiler>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::Repl::Compiler#compile_def:closure_owner<Crystal::Repl::CompiledDef, Crystal::FileModule>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Repl::Compiler>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Repl::Compiler>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::Repl::Compiler#compile_def:closure_owner<Crystal::Repl::CompiledDef, Crystal::FileModule>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Repl::Compiler>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Repl::Compiler>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::Repl::Compiler#compile_def:closure_owner<Crystal::Repl::CompiledDef, Crystal::FileModule>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::Repl::Compiler>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::Repl::Compiler#compile<Crystal::ASTNode+>:Nil'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::Repl::Interpreter#interpret<Crystal::ASTNode+, Hash(String, Crystal::MetaVar)>:Crystal::Repl::Value'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'Crystal::Command#repl:(Crystal::Repl::Value | Nil)'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in '__crystal_main'
from /opt/homebrew/Cellar/crystal/1.7.0/libexec/crystal in 'main'
Any ideas how to solve?