lua-users home
lua-l archive

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



Hi,

BurP dahim wrote:
> ps: if i don't load any lua libs, it won't crash. If i load luaopen_base it
> will crash (i can load any other lib without any problems).

Are you sure you are following the new 5.1 protocol for loading
libraries? You must _not_ call luaopen_* directly. See the code
in linit.c for the proper way to do it (or just call
luaL_openlibs() which opens all standard libraries).

i do it that way (as suggested in the manual) :

	lua_pushcfunction(state, luaopen_base);
	lua_pushstring(state, "");
	lua_call(state, 1, 0);


> so : if my control.dll dynamically load a plugin.dll which is dynamically
> linked to lua and use it. my app will crash.
>
> It looks like a memory problem, but i don't know what i could have done
> wrong.

A common mistake is to link different parts of a project to
different runtime libraries (using different memory allocators).
Check that every EXE/DLL depends on the same MSVCRT DLL.

i link all my projects to Multithreaded DLL runtime (/MD)

this error is particularly hard to identify, as the problem only occur
in release AND outside visual studio.. (i can't "execute without debugging" into
visual because it would work as expected (no crash) )


Bye,
     Mike

_________________________________________________________________
Windows Live Mail : découvrez et testez la version bêta ! http://www.ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d