lua.cr icon indicating copy to clipboard operation
lua.cr copied to clipboard

Cannot use shard

Open devnote-dev opened this issue 2 years ago • 0 comments

I tried installing and using this shard in a testing environment running the following code:

require "lua"

lua = Lua.load
sum = lua.run %q{
  function sum(x, y)
    return x + y
  end

  return sum
}
p sum.as(Lua::Function).call(3.2, 1)

lua.close

This failed on Windows (ran into #39), and fails to compile on WSL (Ubuntu) with the following error message:

/usr/bin/ld: cannot find -llua (this usually means you need to install the development package for liblua): No such file or directory
collect2: error: ld returned 1 exit status
Error: execution of command failed with exit status 1: cc "${@}" -o /home/devonte/.cache/crystal/crystal-run-main.tmp  -rdynamic -L/usr/bin/../lib/crystal -llua -lpcre2-8 -lm -lgc -lpthread -levent -lrt -lpthread -ldl

On Windows, Lua has been installed via vcpkg install liblua, and on WSL sudo apt install liblua5.4-0. Changing the Link annotation in the source code to "liblua", "lua5.4", "lua5.4-0", "liblua5.4", and even "liblua5.4-0" does not work on either platform. How do I use this shard?

devnote-dev avatar Jun 29 '23 20:06 devnote-dev