lua-users home
lua-l archive

Re: embedding - where's print()

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


On 13 Aug 2002 at 14:40, Tomas wrote:
> > Any other function names besides "print" don't work also. Is there any
> > sort of "import" procedure to make a set of functions available?
> 	Yes! You should do lua_baselibopen(L); before using these
> kind of function. 
Thanks!
> See the section 6 of the manual.
> 	Tomas
A two-line explanation! My eyes rushed over them :-)
For the records, here's the troubleshooted embedded "hello world" example that
works on VC6...
extern "C" {
#include "lua.h"
#include "lualib.h"
}
int main() {
 lua_State *L = lua_open(0);
 lua_baselibopen(L);
 lua_dostring(L, "print(\"Hello World!\")");
 return 0;
}
- Fabio

AltStyle によって変換されたページ (->オリジナル) /