lua-users home
lua-l archive

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

On Thu, 17 May 2001 12:23:17 +0200, "Maurizio Ferreira"
<> wrote:

>I'm trying to compile Lua in a dll callable from external programs, written
>in Delphi.
>I made a project with Borland CBuilder 4 std edition,
>including all the sources of the last distribuition (4.0)
>When I try to compile the project, the compiler stops in the following row
>(in lcode.c, near the end)
>const struct OpProperties luaK_opproperties[NUM_OPCODES] = {
>saying  :
>luaK_opproperties already defined
>(or something like that, i don't kow the exact message because I' m trying
>it at home, and now I'm at work)
>If I substitute the constant NUM_OPCODES with its value (49) all works.
>Where is the problem ?
>I'ts a compiler or a program fault ?
>I don't like to modify the source code of the program, but I dont see any
>other way to solve it
>I'm an absolute beginner in C, since I usually works in Delphi.
>I've tried several compiler options, but with the same result.
>Any suggestion ?

	This happens in Borland C++ v 5.5 (C++ Builder 5 with patch).

	I'll suggest to change lcode.h:

lcode.h Line 42:

extern  const struct OpProperties {
  char mode;
  unsigned char push;
  unsigned char pop;
} luaK_opproperties[NUM_OPCODES];  /* <-------- */

	This keeps borland happy and should be compatible with others

	I hope that lua authors include this in next release.