[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Trying to get Lua 5 built using Visual Studio 7 ( .Net 2003 )?
- From: Nicolas Noble <pixel@...>
- Date: Mon, 29 Dec 2003 00:17:07 +0100 (CET)
> >Hello Jarrod,
> >
> > You need to add the lopcodes.c file from [luadir]/src to your project,
> >too.
> >
> > God
> >bless you,
> >
> >
> >Leandro.
> >
> >
> tried that it does not work either :-(
> it has to be some problem with the actual visual studio project file
> itself since everything compile correctly it just won't link to the
> static lib correctly.
This is another issue IMHO. The "missing" symbol is here, but doesn't have
the right name I think. I had this issue before. It is related to the fact
Visual Studio has the baaaaaad habit to mangle C names in the C++ fashion,
and thus sometime generates problems like those. So you may try your luck
a bit with the extern "C" { ... } thingy.
However, I doubt you want the full luac compiler in your project. Maybe
you would even prefer just a function that your main code should call. If
the answer is "yes", then you are just like me :-P
So you might want my "luacomp.c" here:
http://www.nobis-crew.org/~pixel/luacomp.c
It's a hardcut I made into luac so it now behave as a function, that I
called "luacmain". This "luacmain" will ask for a state, a boolean for
"stripping?", and the usual "chunkwriter" with its companion datas. So,
you have to had load previously a _single_ .lua file, (using lua_load) and
this will dump it to a chunkwriter.
My luacmain function should maybe be changed a bit so that it would
combine() serveral previously lua_load()ed files, for example, in this
manner:
void luacmain(lua_State * L, int stripping, lua_Chunkwriter w, void * uD, int n)
{
Proto * f;
int i;
f = combine(L, n);
if (stripping)
strip(L, f);
luaU_dump(L, f, w, uD);
}
Have fun,
-- Nicolas Noble