[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Can't Run .lua Script From Within C Program
- From: "Trent Gamblin" <tmg@...>
- Date: Mon, 28 Feb 2000 14:13:38 -0700
* Shawn LeBlanc <firstname.lastname@example.org> wrote:
> I'm trying to run .lua scripts from within a c Win32 console
> application. The only things I'm doing within the C app is
> lua_dofile("hello.lua"); //hello.lua being from the examples
> and the script only has this line:
> write("hello world, from Lua!\n")
> But it doesn't work. The lua_dofile() returns 1 and I get the
> message "call expression not a function". What I'm doing is
> pretty basic, and to me logical, but it's not working.
write is not part of the standard lua API. To use it, you have to call
lua_iolibopen and link against lualib as well. See section 6 in the
docs for more info.