leafo / lua-enet

Bindings to ENet for Lua
http://leafo.net/lua-enet/
85 stars 25 forks source link

MSVCR80.dll issue #22

Open TheMorc opened 3 years ago

TheMorc commented 3 years ago

I'm not sure what could be the problem, but i'm facing a weird issue with lua-enet. I'm adding multiplayer support to one old C++/SDL game and i was using luasockets before which was working just fine but i wanted to try lua-enet. I'm developing it using Wine on macOS because the game was only for Windows. It's working there using Wine just fine, both client and server connects, all works as it should but i have problems getting it to work on Windows natively. I either get a MSVCR80.dll not found error there or if i put the C++ runtime dll next to lua5.1.dll and other stuff then it shows R6034 An application has made an attempt to load the C runtime library incorrectly. error.

I think that recompiling could help, but i wanted to ask first before compiling it myself.

require "enet" in lua5.1.exe works just fine and also client/server works that way

Ismoh commented 2 years ago

btw msvcr80.dll is inside the luarock installation (windows), so maybe you can add this to windows dlls. not sure if this helps.. just came in my mind while building lua-enet dlls on windows.

other solution would be to build lua-enet on windows with msys2 (MINGW32)

TheMorc commented 2 years ago

btw msvcr80.dll is inside the luarock installation (windows) other solution would be to build lua-enet on windows with msys2 (MINGW32)

hmm, good to know. I'll try it, maybe it'll work, who knows..

TheMorc commented 2 years ago

oh god!! so do you want to know what was the problem?

I downloaded the LuaRocks source package that includes a built Lua5.1, replaced lua5.1.dll in the game and guess what.

It works!

edit: it's quite interesting that i tried quite literally every single thing but looking at luarocks never got me thinking to also try it... Thanks again so, so much!

Ismoh commented 2 years ago

I am new to lua, gcc and other building stuff related to lua libraries. So I have no f**ing idea what I am doing, but while reading issues, I thought it might help somehow! Nice to hear!

Try to remember or add a file to know, which LuaRocks version was used, might be necessary in future :)