Advertisement

LUA output redirection

Started by July 24, 2004 04:38 PM
1 comment, last by Lacutis 20 years, 3 months ago
Hi Everyone, Although not directly game related, I have noticed lots posted here about lua, so I figured I would ask everyone here if they have experienced this problem before. I am incorperating lua into a software suite that I am created so that I can run scripts and everything instead of recompiling. This is an MFC app. I allocate a console for my program via AllocConsole(). Any print statements within a lua script go nowhere. I have also tired redirecting the stdout stuff, but it doesn't seem to be working. Is there any way of having the output redirected to the console that I have through AllocConsole()? Many thanks, Brendan Meeder PS- I've read through the many tutorials that are available and none of them are working for me. Is this because I compiled the libraries before it knows which output stream to use?
Brendan"Mathematics is the Queen of the Sciences, and Arithmetic the Queen of Mathematics" -Gauss
Couldnt you just register WriteConsole() in lua and call that instead of print ?
Advertisement
That is what I would suggest.

You could try including the print.c file in the luac directory and registering it as print, that might do the trick.

Basically is it looks like print is not defined when lua is used as a library. So either include print.c to your project and register it, or write your own function and register that as print (what I would suggest).

This topic is closed to new replies.

Advertisement