lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Why did you use lua5.4.2-static.lib for dll ?

вт, 27 окт. 2020 г. в 14:22, Ranier Vilela <ranier.vf@gmail.com>:
>
> Hi,
>
> I'm trying to create a module in DLL, with msvc 2019 (64 bits).
> When I call the C function inside Lua, it is giving the following error:
> lua: atests.lua: 6: attempt to call a nil value (global 'atest1')
> stack traceback:
>          atests.lua: 6: in main chunk
>          [C]: in?
>
> Do I need something more to create the DLL to work with Lua?
> DEFINES=/D "_WIN32" /D "DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_WARNINGS" /D "LUA_BUILD_AS_DLL"
> LDFLAGS=/implib:libtest.lib /out:libtest.dll /verbose /subsystem:console /debug
> link /DLL $(LDFLAGS) lua5.4.2-static.lib *.obj
>
> regards,
> Ranier Vilela