Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket = require("socket") #1077

Closed
zmarotrix opened this issue Dec 19, 2017 · 14 comments

Comments

Projects
None yet
4 participants
@zmarotrix
Copy link

commented Dec 19, 2017

On Windows, socket = require("socket") causes an error saying;

NLua.Exceptions.LuaScriptException: error loading module 'socket.core' from file '.\socket\core.dll':
    dynamic libraries not enabled; check your Lua installation

I've recompiled my Lua interpreter and made sure they are enabled. Does Bizhawk have a built-in Lua interpreter? If so, how can I update it?

@vadosnaprimer

This comment has been minimized.

Copy link
Contributor

commented Dec 19, 2017

Try luainterface instead of nlua. Somewhere in advanced config.

@zmarotrix

This comment has been minimized.

Copy link
Author

commented Dec 19, 2017

I got the same error.

@zmarotrix

This comment has been minimized.

Copy link
Author

commented Dec 19, 2017

Nevermind, I reloaded the Emulator and now I'm getting this:

NLua.Exceptions.LuaScriptException: error loading module 'socket.core' from file '.\socket\core.dll':
%1 is not a valid Win32 application.

@vadosnaprimer

This comment has been minimized.

Copy link
Contributor

commented Dec 20, 2017

You're obviously still using nlua, you need luainterface.

https://i.imgur.com/Dlc71c3.png

@zmarotrix

This comment has been minimized.

Copy link
Author

commented Dec 21, 2017

Weird, I have that option checked, restarted the emulator and all. I'm not sure what's going on.

@zmarotrix

This comment has been minimized.

Copy link
Author

commented Dec 21, 2017

Here are my settings
https://i.imgur.com/zc8tf4T.png

Here is the output
https://i.imgur.com/u8WDzXG.png

@vadosnaprimer

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2017

Yeah this is stupid. It seems to need @zeromus.

@zeromus

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2017

You cant just slop random lua plugins into bizhawk. See here for all the annoying complexities:

https://stackoverflow.com/questions/33428382/add-luasocket-to-program-bizhawk-shipped-with-own-lua-environment

Sounds like your bug is due to using a 32bit dll, anyway

@zeromus zeromus added the Support label Dec 21, 2017

@udoheld

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2018

I followed the instructions given on SO e.g.

/emuhawk.exe
/Lua (untouched)
/Socket/ftp.lua,http.lua,etc.
/ltn12.lua,socket.lua,mime.lua
/lua5.1.dll
/mytest.lua

I get the following error leaving out the "core.dll" as described:

NLua.Exceptions.LuaScriptException:
[string "main"]:2: module 'socket.core' not found:
no field package.preload['socket.core']
no file '.\socket\core.lua'
no file 'D:\emu\BizHawk-2.2.1\lua\socket\core.lua'
no file 'D:\emu\BizHawk-2.2.1\lua\socket\core\init.lua'
no file 'D:\emu\BizHawk-2.2.1\socket\core.lua'
no file 'D:\emu\BizHawk-2.2.1\socket\core\init.lua'
no file 'd:\Program Files (x86)\Lua\5.1\lua\socket\core.luac'
no file '.\socket\core.dll'
no file 'D:\emu\BizHawk-2.2.1\socket\core.dll'
no file 'D:\emu\BizHawk-2.2.1\loadall.dll'
no file '.\socket.dll'
no file 'D:\emu\BizHawk-2.2.1\socket.dll'
no file 'D:\emu\BizHawk-2.2.1\loadall.dll'

If I do put the "core.dll" from the download above into the socket folder it will complain:

NLua.Exceptions.LuaScriptException: error loading module 'socket.core' from file '.\socket\core.dll':
%1 is not a valid Win32 application.

@zeromus

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2018

You must also change the bizhawk setting to use luainterface instead of nlua

@udoheld

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2018

I changed that already and the config.ini reads (for both of my release and dev versions)

"UseNLua": false,

and when trying the current dev version it seems to pull load "LuaInterface.dll" at "EmuHawk.exe!BizHawk.Client.EmuHawk.Program.CurrentDomain_AssemblyResolve(object sender, System.ResolveEventArgs args) Line 347"
so I'd say it does that. And it should be the same for the released version.

The message is slightly different:

NLua.Exceptions.LuaScriptException:
error loading module 'socket.core' from file '.\socket\core.dll':
The specified module could not be found.

@udoheld

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2018

Ok. I noticed for dev the file structure has to be put into the "output" directory, but it now prints

NLua.Exceptions.LuaScriptException: error loading module 'socket.core' from file '.\socket\core.dll':
%1 is not a valid Win32 application.

as well.

@zeromus zeromus closed this in 5b17e5b Jan 15, 2018

@zeromus

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2018

ok, NOW the instructions on stackoverflow works.
Looks like even when you use luainterface all the errors and stuff say nlua, because lame reasons

@udoheld

This comment has been minimized.

Copy link
Contributor

commented Jan 16, 2018

Thx, it works for me now. @zmarotrix you may want to retry the daily build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.