lua-users home
lua-l archive

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


Hello LuaUsers!

Please help me to find my mistake in 5.1 alpha compilation.
1. In MS VisualStudio 6.0 I create an empty Win32 console application.
2. add all.c file to project   ( there is no any LUA_COMPAT_ definitions
and so on)

3. compile is ok.
all lua-5.1-alpha\test scripts work fine.


But if I try to use modules, some errors occurs:

test file test.lua:

-------------
require "mymod"
assert (mymod)
mymod.ccc()
--------------

file mymod.lua:

---------------
module("mymod") -- or module(...)

function ccc()
     print("Hello world, from ",_VERSION,"!\n")
end
---------------

If I run lua5.1w6 all works fine:
   Hello world, from       Lua 5.1 (work6) !

but if I run lua5.1alpha the error is:

Compiler.exe test.lua
Compiler.exe: mymod.lua:4: attempt to call global 'print' (a nil value)
stack traceback:
        mymod.lua:4: in function 'ccc'
        test.lua:4: in main chunk
        [C]: ?

After  module(...) all global variables is undefined!

BUT! if I add compat-5.1.lua reference to test.lua, all works fine.

May be I need some new preprocessor definitions to compile correct
executable?
-- 
Best regards,
Stukov
mailto:Stukov@gala.net