Closed SwissalpS closed 4 years ago
Hi, @SwissalpS I'm not affiliated with this project but I had the same problem. You need to add your luarocks path to your LUA_PATH environment variable. When Lua looks for a required library file, it looks in all the directories listed by the LUA_PATH environment variable. I assume you are on either MacOS or Linux, based on your /usr/ paths. If you type
luarocks path
you will see an output for what your LUA_PATH should be. in a bash terminal, if you type
eval $(luarocks path)
it should set your LUA_PATH to the correct variable. If you want this to carry over to your next session, add that line to your ~/.bashrc
file and it will set the path every time you open a terminal. I'm not sure if this solution will work on newer macbooks because they have moved from bash to zsh, and I have no experience with zsh. If you're using zsh and the problem continues, find someone who knows zsh and tell them the problem and they can probably help you
Thank you very much @collinoswalt. That is a very good explanation.
I'm using Fedora 32 and no zsh Have made a wrapper shell script that first does
export LUA_CPATH="/usr/lib/lua/5.3/?.so;/usr/lib/lua/5.3/SDL/?.so;";
before running
lua mySDLapp.lua
eval $(luarocks path)
is better for most compatibility with other platforms. Thanks again :D
installed using luarocks, downloaded example and tried to run it but get errors that SDL can't be found:
Which install step did I miss?