0

when loading a .dll file from lua it gives me this error:

loop or previous error loading module 'wildcard'

whats wrong? @edit: @lhf: ive changed the filename but now its giving me these errors:

> dofile("_test.lua")

_test.lua:1: module 'wildcard' not found: no field package.preload['wildcard'] no file '.\wildcard.lua' no file 'D:\luasocket-2.0.2-lua-5.1.2-Win32-vc6\lua\wildcard.lua' no file 'D:\luasocket-2.0.2-lua-5.1.2-Win32-vc6\lua\wildcard\init.lua' no file 'D:\luasocket-2.0.2-lua-5.1.2-Win32-vc6\wildcard.lua' no file 'D:\luasocket-2.0.2-lua-5.1.2-Win32-vc6\wildcard\init.lua' no file '.\wildcard.dll' no file 'D:\luasocket-2.0.2-lua-5.1.2-Win32-vc6\wildcard.dll' no file 'D:\luasocket-2.0.2-lua-5.1.2-Win32-vc6\loadall.dll' stack traceback: [C]: in function 'require' _test.lua:1: in main chunk [C]: in function 'dofile' stdin:1: in main chunk [C]: ? >

2
  • 6
    Without code, how the hell are we supposed to know? Commented Nov 16, 2010 at 22:35
  • do you want the C code or the lua code? I'm sry about that. Commented Nov 17, 2010 at 13:28

2 Answers 2

1

You probably have a wildcard.lua file with

require"wildcard"

and expect that this will load wildcard.dll. It won't because priority is given to Lua modules, hence your loop.

Sign up to request clarification or add additional context in comments.

Comments

0

Try

package.loaded.wildcard = false

See refman which describes the package table.

2 Comments

now it works but its giving me nil values on the functions in the .dll
Perhaps the DLL is defective, or wasn't written for (your version of) Lua. There is no way to tell from the information you've provided. I see you have used a C++ tag; the DLL should have a C interface, not mangled C++ names.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.