I'm trying to do this using [nimLua](https://github.com/jangko/nimLUA) and 
running it in Love2D.

I'm not sure how to do this though. I watched a tutorial on how to do this in 
C, and I tried something similar, but ofc it doesn't work:
    
    
    # sllib.nim
    import nimlua
    
    proc foo*(L:PState):cint {.stdcall, exportc, dynlib.} =
        echo "I AM THE FOO!!!"
        L.pushnumber(10)
        return 1
    
    proc luaopen_test*(L:PState):cint {.stdcall, exportc, dynlib.} =
        L.bindFunction("foo", foo)
        return 0
    
    
    Run

I presume I need those pragmas. I read somewhere about them.

So I compiled to a dll, but then when I do `require "sllib"` in lua, it crashes 
my app.

I don't know what to do... 

Reply via email to