[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: 回复： Re: Problem calling c++ from Lua (MS-Windows version)
- From: Michael Gogins <michael.gogins@...>
- Date: Thu, 24 Feb 2011 13:09:46 -0500
It is also useful to know that dependency walker can profile a running
program. In this case, that would be the Lua runtime, with command
line arguments specifying the script to run. I always enable full
paths in the trace messages so I can see where the program is actually
loading libraries from.
On Thu, Feb 24, 2011 at 12:38 PM, Jerome Vuarand
> 2011/2/24 jseb <email@example.com>:
>>> 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
>> Windows mysteries :/
> A very useful tool to debug such DLL problems is Dependency Walker
> . 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).
>  http://www.dependencywalker.com/
Michael dot Gogins at gmail dot com