lua-users home
lua-l archive

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


With Lua 5.1.4 distribution, it is possible to compile Lua in a single
file, called an amalgamation.
In "etc" directory is a C file called "all.c", that just #include all
source files.
Building Lua that way can be both easy and fast.

I tried to build Lua 5.2.0 (alpha) in the same way. Since the 'etc'
directory is not there anymore (why?), I copied 'all.c' from 5.1.4 and
added 'lcorolib.c' and 'lbitlib.c' at the end.
This compiles correctly on GCC. But with Microsoft compiler there is
the following error:

  src\ltm.h(49) : error C2133: 'luaT_typenames_' : unknown size

This comes because when building Lua as an amalgamation, 'luaall_c' is
defined, which leads to 'LUAI_DDEF' being defined as 'static'.
And line 49 in ltm.h now reads out:
  static const char *const luaT_typenames_[];

And it is illegal to declare a non-extern array of unspecified size.
To verify that it is not a limitation of Microsoft compiler, I tried
with Comeau compiler [1], probably the most standard compliant C/C++
compiler, and it also yields an error.

[1] http://www.comeaucomputing.com/tryitout/