🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

LUA output redirection

Started by
1 comment, last by Lacutis 19 years, 11 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
Advertisement
Couldnt you just register WriteConsole() in lua and call that instead of print ?
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