lua-users home
lua-l archive

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

2011/2/24 jseb <>:
>> Rename luaopen_libido to luaopen_foo
> Thanks for the suggestion
> "libido" ... that's a nice lapsus :)
> Anyway, it was not working either.
> Finally, i've found it:
> I was launching the lua interpreter on MSYS or in CMD (windows shell): same
> error with both of them.
> Then i tried to write a little script (just the "require" on my lib) and
> then , launched it directly via "windows explorer". I've got an error of a
> missing dll this time.
> So... the answer after a few googling:
> with mingw, compile it with flag "-static-libgcc"
> No idea how to manage this with Visual Studio.
> Now the "require" work , whatever environment: MSYS, CMD, and "windows
> explorer".
> Windows mysteries :/

A very useful tool to debug such DLL problems is Dependency Walker
[1]. It can tell you what dependencies a DLL has (and it displays
warning if it's unable to find them). It is also useful to examine
exported symbols, and check that your luaopen_foo is properly named
and not mangled.

And to find out why -static-libgcc solves the problem, and how to
solve it with MSVC, you will have to provide more details, such as
what DLL exactly is reported missing, what unusual things you might
have in your PATH, or whether you may have several foo.dll files in
the PATH (for example one for the C/C++ library, and one for the Lua/C
binding module).