Closed kraxarn closed 3 years ago
Hi; would you mind providing some extra information to see if I can help?
require
line where you are loading LuaSDL2 look like?package.path
and package.cpath
in your Lua script?My best guess would be that you are using Lua 5.1, while the build system defaults to building a Lua 5.2 version of the module.
If you think that's the case, you can change the targeted Lua version; see Customizing The Build
Lua is installed to /usr/local/lib/lua/5.1/, but I also tried running it from the directory of the program. I'm running Ubuntu 15.04 x64 The require line is the same as in the example: local SDL = require 'SDL' And how do I check that package.path and cpath?
To check the paths, run this from Lua, either as a script or interactively:
print(package.path)
print(package.cpath)
It looks like you compiled Lua yourself, so I'm assuming you compiled the SDL module as well; did you set the Lua version to 5.1 when you did so?
Sorry, I meant this, luasdl, installed it with make install Lua is not compiled by me, it's installed from the official Ubuntu stuff
package.path: ./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua
package.cpath: ./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so
Huh, Ubuntu installs Lua under /usr/local by default? But anyways, it seems like the module's being found, at least.
So, I assume you ran cmake
at some point before running make install
. Did you pass any flags to it?
If not, try passing -DWITH_LUAVER=51
at the cmake step, and rebuild.
Nah, it's installed to /usr/bin/lua5.1 And yea, I passed that flag to it, since I'm using Lua 5.1, haven't tried any other flag or no flag
Sorry for delay, was on vacation. I... am kinda baffled, unfortunately.
Would you be willing to try installing it through Luarocks? There should be an Ubuntu package.
I've changed the way the bindings links to Lua (it shouldn't link to it) any issue should be fixed now (tested on mac and Linux).
I get the following error when trying to require the .so file from a lua project:
"error loading module 'SDL' from file '/usr/local/lib/lua/5.1/SDL.so'" : 0 : undefined symbol