Re: Lua and vc++.net
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua and vc++.net
- From: Fabio Mascarenhas <fabiomasc@...>
- Date: 2004年9月24日 19:58:44 -0300
Hi Mathijs,
Add an empty definition of lua_State to your app:
struct lua_State {};
The only definition of lua_State is in unmanaged code (the Lua C code),
so the CLR can't find it and throws that exception. In fact, if you open
your managed assembly with ildasm you won't find any reference to the
Lua DLL at all. They are inside the unmanaged code of the stubs the
compiler creates (you'll see lua_open, lua_close etc. in your managed
assembly, those are the stubs that load the Lua DLL).
--
Fabio Mascarenhas
mathijs wrote:
Hello,
I'm having a problem using lua and .net. I'm using an unmanaged class
with lua in it in a managed .net app. It compiles fine but when calling
the first function that uses lua I get the following error:
An unhandled exception of type 'System.TypeLoadException' occurred
in Medusa Editor.exe
Additional information: Could not load type lua_State from assembly
Medusa Editor, Version=1.0.1728.36664, Culture=neutral,
PublicKeyToken=null.
The same class works fine in a fully unmanaged class.
Anyone had this problem before and/or knows how to fix it?
Thanks in advance,
Mathijs Baaijens.