lua-users home
lua-l archive

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

I wrote an extension of Lua. Now I am writing a Lua script which makes a call to a function in that extension.

signature of the function is as follows
get_version(char* a, int b)

My Lua script is as follows

Version = '          '  --  # Create a 10 character buffer to store the version string
status = extLua:get_version(Version,10)
if (status != SUCCESS) then die ("Returned bad status: $status") end
print("\nCurrent Version: " Version "\n")
print("\nEnd of example\n")

When I run the script file this is what I get

> dofile("C:\\a\\ScriptingLanguageSupport\\Lua1.lua")
Error in get_version expected 2..2 args, got 3
stack traceback:
        [C]: in function 'get_version'
        C:\a\ScriptingLanguageSupport\Lua1.lua:14: in main chunk
        [C]: in function 'dofile'
        stdin:1: in main chunk
        [C]: ?

It shows the error message that it is getting 3 arguments in function call. But I am passing only 2 arguments. Where is it getting the third argument from ??